This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] mt_allocator: spare mem & fix alignment problems
- From: "B. Kosnik" <bkoz at nabi dot net>
- To: libstdc++ at gcc dot gnu dot org
- Date: Thu, 25 Mar 2004 11:26:05 -0600
- Subject: Re: [Patch] mt_allocator: spare mem & fix alignment problems
- References: <40630DF2.7040507@suse.de>
>the below does two, in principle unrelated, things:
>
> 1- Changes struct block_record to a union: in fact next and
> thread_id are never used at the same time. The former only
> when the block is unused and linked to the others of the
> same thread, the latter only when used. This allows to spare
> a good amount of memory (see attachments)
>
> 2- Adds a configurable _M_min_bin, which sets the smallest bin
> size. The current 1 byte, frankly, doesn't make much sense
> and, anyway, raising it to 8 bytes allows to fix the alignment
> problems we were experiencing on ia64 (now the alignment is
> the same used by default by pool_allocator).
Thanks. All this looks great!
>Overall, the performance seem slightly improved (see attachments), but
>perhaps the heuristics in deallocate should be tweaked again.
After you check this in I'll take it for a spin as well.
>Tested x86/x86_64/ia64 linux: now same results on all three, with the
>only unsolved problem (wrt new/pool-allocator) of pthread7-rope.
This is really great news!
I'm not quite sure what is up with pthread7-rope. Do you know if this
fails if std::string is used instead of rope? I'm just curious.
-benjamin