[Patch] mt_allocator: spare mem & fix alignment problems
Paolo Carlini
pcarlini@suse.de
Thu Mar 25 17:26:00 GMT 2004
Hi,
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).
Overall, the performance seem slightly improved (see attachments), but
perhaps the heuristics in deallocate should be tweaked again.
Tested x86/x86_64/ia64 linux: now same results on all three, with the
only unsolved problem (wrt new/pool-allocator) of pthread7-rope.
Will wait a while for comments, then commit to mainline.
Paolo.
//////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_mt_2
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040325/6b4560a3/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_mt_2
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040325/6b4560a3/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libstdc++-performance.sum.new
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040325/6b4560a3/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libstdc++-performance.sum.old
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040325/6b4560a3/attachment-0003.ksh>
More information about the Libstdc++
mailing list