On 25 Sep 2000, at 17:52, Adrian Chadd <adrian@creative.net.au> wrote:
>
> This patch is a little rough but it converts a couple of "should have been
> MemPool'ed a long time ago" structures.
>
> Can I get someone to look at this and tell me if its right? If so, I'll
> commit it.
>
I wanted to ask few clarifications.
1. Why do we need to always clear alloced memory?
memPool seems to only use calloc to actually get memory. When it gets
memory from pools, it doesn't clear it, instead it clears mem always
during free. Seems weird, although no difference.
memset adds some overhead, even if very small, it adds up (especially
on systems with limited CPU-ram bandwidth, like Intel). Do we actually
need to clear the membuffers? Maybe there would be reason to split
memPoolAlloc into separate versions: memPoolMalloc and memPoolCalloc?
2. memPool does not try to align allocations at any size. calloc() does
it at small sizes (8). Maybe we should add a check that when allocations
of VM page size granularity occurs, we should use valloc() or memalign()
As Henrik has noted, this could speedup OS->userspace disk buffering by
reducing mem-mem copying. Also, if we tune dlmalloc.c to use mmaps for
allocations > 4-16KB, we could eventually somewhat reduce memory
fragmentation also.
------------------------------------
Andres Kroonmaa <andre@online.ee>
Delfi Online
Tel: 6501 731, Fax: 6501 708
Pärnu mnt. 158, Tallinn,
11317 Estonia
Received on Mon Sep 25 2000 - 04:48:15 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:38 MST