container<POD> refactoring
Gabriel Dos Reis
gdr@cs.tamu.edu
Mon Sep 20 18:28:00 GMT 2004
Joe Buck <Joe.Buck@synopsys.COM> writes:
| Has anyone done any thinking about adding specializations for avoiding
| bloat with containers of POD types? For std::vector, it seems that all
| of the out-of-line functions other than the == and < operators depend
| only on the size of the POD, and nothing else.
I would say this is something best done at the linker level.
User-codes may detect -- at program source level -- whether we
specialize or not.
I've heard persistent reports that Microsoft's linker is capable (and is
actually doing it) of sharing morally same specializations codes.
|
| Just specializing container<T*> would be easier, and a win for some.
| But a complete job might manage to have one copy, in the library, of
| out-of-line code for almost all container<POD> functions that use the
| default allocator.
--
Gabriel Dos Reis
gdr@cs.tamu.edu
Texas A&M University -- Computer Science Department
301, Bright Building -- College Station, TX 77843-3112
More information about the Libstdc++
mailing list