zero-alloc cache (was Re: [v3] Fix PR libstdc++/10276)

Jerry Quinn jlquinn@optonline.net
Mon Apr 28 19:48:00 GMT 2003


Carlo Wood writes:
 > On Mon, Apr 28, 2003 at 02:22:09AM -0400, Jerry Quinn wrote:
 > > Oops.  The following patch moves the hook to pass the static cache to
 > > the stream constructors.  It passes make check-abi, but is it actually
 > > safe?
 > 
 > It seems to "break" the binary API - that is, the object name of
 > the init function without a locale_cache being passed is changed;
 > as a result, programs compiled with libstdc++ version 5.0.x with
 > x <= 2 will not link anymore with libstdc++-5.0.3.
 > 
 > While this solution might be ok for libstdc++-6 (although I'd ask
 > someone else about that; I am not an API expert), I think we should
 > use a totally new constructor for this one.
 > 
 > Thus:
 > 
 > keep  explicit basic_istream(__streambuf_type* __sb);
 > 
 > add   explicit basic_istream(__streambuf_type* __sb, __locale_cache<_CharT>* __lc);
 > 
 > What do you think?

This is also fine by me.  I wasn't sure if it was an issue or not.

Does anyone know why make check-abi doesn't complain about it?

 > >   The callback_list object gets created, but never deleted.  I can
 > > work around this one, but it's going to get very ugly with switch
 > > statements looking explicitly for the static cache objects in places.
 > 
 > Please don't :), I am hoping for an interface that can be used for
 > other (global) ostream objects too, not just the standard streams.

OK, I'll see if I can conjure another way of dealing with it.

Jerry



More information about the Libstdc++ mailing list