malloc() and spinlocks
Lubos Lunak
l.lunak@suse.cz
Tue Nov 26 05:30:00 GMT 2002
On Monday 25 November 2002 17:39, David Boreham wrote:
[snip]
>
> Hmm....I spend most of my life grumbling that code is optimized for the
> rare case that the application is single threaded and the machine only has
> one CPU :)
>
> Please do not break the SMP performance of malloc (at least don't break it
> more than it is already).
>
> Thanks.
I don't want to break anything. I just want something like this - see the
thread-m.h.patch attachment. I don't know if the code should be duplicated or
if the spinlock code is not necessary in the not _LIBC part. The
mallo.c.patch is for __inline__ - I don't know if you even want to apply
that, and I doubt it can go in in this form (having simply __inline__ there),
I simply added a couple of __inline__ where I liked :). As I said, the
spinlock one is the really important.
--
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o. e-mail: l.lunak@suse.cz , l.lunak@kde.org
Drahobejlova 27 tel: +420 2 9654 2373
190 00 Praha 9 fax: +420 2 9654 2374
Czech Republic http://www.suse.cz/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thread-m.h.patch
Type: text/x-diff
Size: 1675 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20021126/13966fdd/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: malloc.c.patch
Type: text/x-diff
Size: 26147 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20021126/13966fdd/attachment-0001.bin>
More information about the Libc-alpha
mailing list