[PATCH] libc++ iostream: Clean up standard I/O stream object creation in preparation for conditionalizing streams

Ed Schouten ed at nuxi.nl
Mon Mar 16 09:22:32 PDT 2015

In http://reviews.llvm.org/D8342#140948, @jroelofs wrote:

> I'm going to have to defer to @mclow.lists on this one... I'm not sure whether the state_types have to be contiguous or not.

I just looked through `include/__std_stream` and it doesn't seem to be the case that they need to be contiguous.

The address of the `mbstate_t` is stored in the `__st_` member. A reference to it gets passed on to `codecvt` objects. The `codecvt` code in `src/locale.cpp` passes on the addresses to `wcrtomb_l()` and friends. It looks like we never do any pointer arithmetic on them.



More information about the cfe-commits mailing list