This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: patch: mt_allocator.h
>The most relevant changes:
>
> 1- Everything is inside the implementation struct __mt_base.
> 2- In order to deal with multiple definitions issues, I used
> a trick that I (re-)learned from Wolfgang Bangerth: __mt_base
> has a dummy template parameter enforcing weak linkage.
Agh.
Why this?
2004-03-27 Paolo Carlini <pcarlini@suse.de>
* include/ext/mt_allocator.h: Uglify consistently names of
variables, members and classes; tidy.
In particular, I don't think the names of the nested classes have to
be uglified.
__gnu_cxx::__mt_base:: would seem to be enough.
Anyway.
In the new patch, I really dislike the idea of making a dummy template,
just to work around linkage problems. That particular hack is something
that we're trying to remove, not propagate...
I'd rather have lazy initialization of the __mt_base class data, and
have __mt_base be a simple class, and not be a template. I'll try to
work up that solution.
However, I agree, the single pool is probably desired. The downside is
that this will impact the ability to actually tune the memory allocation
parameters, since you'd have to do this before first allocation.
best,
benjamin