[PATCH] basic_filebuf: 45628 + non-modal I/O

David Krauss potswa@mac.com
Thu Sep 23 05:23:00 GMT 2010


On Sep 22, 2010, at 11:36 PM, Paolo Carlini wrote:

> Hi,
>> 
>> OK. It's unfortunate that the ABI encompasses every aspect of the runtime data structure. For example, I've already broken user-derived filebuf classes that assume _M_reading will always be false after seekoff.
> 
> Just to clarify: luckily, we don't provide this kind of 'ABI' guarantee. And, well I suppose you already know that, because we don't want to waste time committing and reverting the same patch in 24 hours ;) More seriously, about your idea of not using _M_reading and _M_writing entirely, I'm in general in favor - with the usual caveats about performance, etc, we don't want to call virtuals when we could have avoided it, and so on. Note, of course that, for the time being, we cannot really *remove* the data members, because that changes layout and size of the basic_filebuf class and severely breaks the ABI. If therefore it would be convenient or not to do anyway the change right now I don't know.

Well, on that note:

- The change doesn't eliminate them both; _M_writing is replaced
with _M_post_overflow, which is true if "the last virtual function
called was overflow."

- Besides simplification/cleanup, the point is to free space within
the ABI constraint. _M_reading can be reused to cache the value of
__check_facet(_M_codecvt).always_noconv(), a virtual call which
seems to happen too frequently in the current impl.



More information about the Libstdc++ mailing list