[Patch] mt_allocator: spare mem & fix alignment problems
B. Kosnik
bkoz@nabi.net
Thu Mar 25 18:20:00 GMT 2004
>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
More information about the Libstdc++
mailing list