httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <>
Subject Re: More on malloc stuff
Date Sat, 27 Dec 1997 18:48:45 GMT
Dean Gaudet wrote:
> There's more to it than just changing that though ... because we don't
> control all the malloc's that happen we need to malloc (N+1)*page_size - 1
> bytes when we really want N*page_size bytes, and we have to round up to
> the nearest page size to align the allocation.  So we essentially end up
> wasting memory if we do it for each call to malloc_block. 

Yeah... the main idea is that when we actually have to do a
malloc, it's expensive to do so. We should be "agressive" and
grab more than we need thus avoiding, if possible, future malloc's
and just use what's available in our personal free list.

And since malloc's are expensive, they are usually less expensive
when done at a natural pagesize, then some fraction thereof.

This isn't a massive overhaul; it a simple little improvement.
Not all code changes, IMO, require a total rewrite of what we
current have :) When my car's performance needs a bit of a
boost, I do a tune-up rather than an overhaul :) :)
      Jim Jagielski            |       jaguNET Access Services           |
            "Look at me! I'm wearing a cardboard belt!"

View raw message