This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] default linux allocator


On Wed, Jul 14, 2004 at 03:39:28PM -0700, Mark Mitchell wrote:
> Carlo Wood wrote:
> >As a result - people who upgrade their compiler from 3.4.0
> >to 3.4.1 have to recompile libcwd.
> >
> That's exactly the kind of thing I'm worried about.

But that is, as I said, because libcwd uses __pool_alloc directly
(which is not a supported interface I think).

> If in file1.h, I do:
> 
>  std::vector<int> v;
> 
> and file1.cc, compiled with 3.4.1 does:
> 
>  v.push(3)
> 
> and file 2.cc, compiled with 3.4.2 does:
> 
>  v.push(4)
> 
> what allocator is being used by these files?  How do we know it will be 
> compatible, even if the allocator code has been inlined into the .o files?

Both files would use

00000000 W std::allocator<int>::allocator()
00000000 W std::allocator<int>::allocator(std::allocator<int> const&)
00000000 W std::allocator<int>::~allocator()
00000000 W std::allocator<int>::~allocator()

These are link-once routines that call operater new.
At link time, only one of them would be used, in the end, I guess.
But we don't know which - and they might have different sizes if
they indeed contain inlined code of the pool (but they apparently
do because there is no __pool_alloc instantiation anywhere).
I didn't check that however.  Actually, I don't understand why
not.

-- 
Carlo Wood <carlo@alinoe.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]