pika-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pika-dev] hackerlab fsplay.[ch] status


From: Tom Lord
Subject: Re: [Pika-dev] hackerlab fsplay.[ch] status
Date: Thu, 6 May 2004 12:36:54 -0700 (PDT)

    > From: Andreas Rottmann <address@hidden>

    > I've started porting the GLib memchunk implementationn to
    > hackerlab. 

Why?

This code bugs me a little bit.   It seems to me that in the common
case it will be doing nothing that the underlying malloc won't already
be doing, probably better.

I can understand using free-lists of particular data structures from
time to time -- but this goes further than that, attempting to return
memory to the general store when it can.  That's a job for malloc.

If anything, I would expect using something like memchunks to (most of
the time) increase fragmentation.  The reason is that separate
memchunks will be allocated for each distinct _type_ being allocated
from memchunks, whereas with malloc, chunks will be allocated only for
each distinct (rounded) _size_.  There are only a couple different
(from the allocator perspective) common sizes of things that are
heavily allocated and deallocated even though there many be many
different types having those sizes.

What's the case for having this facility?

-t





reply via email to

[Prev in Thread] Current Thread [Next in Thread]