This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: src/stlinst.cc and relationship to the SGI STL
- To: "Smithers, Kit" <kit.smithers@eds.com>
- Subject: Re: src/stlinst.cc and relationship to the SGI STL
- From: Benjamin Kosnik <bkoz@cygnus.com>
- Date: Tue, 20 Apr 1999 12:11:08 -0700 (PDT)
- cc: libstdc++@sourceware.cygnus.com
> I wonder if any of you can help me. I'm trying to understand the
> relationship between the file src/stlinst.cc and the SGI standard template
> library. As I understand it the SGI STL is intended to only be a set of
> header files... but this file seems to be a dependency on the implementation
> of the SGI STL and if you dont include it as part of the standard library
> then programs using the STL wont link.
It's an explicit instantiation file, and is one way of controlling what
template instantiations are produced.
> In my particular case if you compare the older version of the STL that comes
> with egcs1.1.1 then you find that they've declared (or renamed) a different
> set of static data members in __default_alloc_template. Code built against
> the newer STL doesnt link with older libstdc++.
Binary compatibility should not be assumed amongst different releases
of the STL.
> I cant find a reference to "default_alloc" anywhere in the standard (I only
> have the draft 2 version) nor was I expecting to. This does seem to be some
> form of "collusion" between the SGI STL and libstdc++ which I wasnt
> expecting.
In general, any name with a prepended "__" or a "_" followed by a capital
letter is reserved for implementors. Thus, you can rightly assume that
"__default_alloc_template" is a detail of this specific implemtation.
stl/bits/stl_alloc.h says:
"// Default node allocator.
// With a reasonable compiler, this should be roughly as fast as the
// original STL class-specific allocators, but with less fragmentation.
// Default_alloc_template parameters are experimental and MAY
// DISAPPEAR in the future."
That pretty much sums it up.
-Benjamin