Greatly enhance the slab allocator.
authorMichael Poole <mdpoole@troilus.org>
Fri, 14 Dec 2007 04:47:10 +0000 (23:47 -0500)
committerMichael Poole <mdpoole@troilus.org>
Fri, 14 Dec 2007 04:47:10 +0000 (23:47 -0500)
commit11ba875075db4905ec73226e3c09e8ad1b7965d4
tree69ab30813f05a921a43fcee78377e87e73d418f4
parent06c6659adc40c92eba5473f2dd30db51422e3ab4
Greatly enhance the slab allocator.

configure.in: Look for mprotect() function.
src/Makefile.am: Add slab-read program.
src/slab-read.c: New helper program.
src/alloc-slab.c (SLAB_DEBUG_HEADER): New bitmask macro.
  (SLAB_DEBUG_LOG): Likewise.  Implement its functions.
  (SLAB_DEBUG_PERMS): Likewise.  Implement its functions.
  (SLAB_DEBUG): Update default.
  (slab_alloc): Call slab_unprotect() when pulling free_slab_head.  Call
    slab_log_alloc() on any slab allocation.
  (slab_unalloc): Call slab_log_free() on slab unallocation.  Call
    slab_unprotect() and slab_protect() when manipulating free slabs.
  (slab_malloc): Call slab_log_alloc() on large object allocation.
  (slab_free): Call slab_log_unmap() on large object free.
configure.in
src/Makefile.am
src/alloc-slab.c
src/slab-read.c [new file with mode: 0644]