DragonFly-18.104.22.1686.g11e45 master include stdlib.h lib/libc/stdlib nmalloc.c
dillon at crater.dragonflybsd.org
Tue Apr 28 09:36:10 PDT 2009
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Tue Apr 28 09:30:10 2009 -0700
Add posix_memalign(), fix minor bug in nmalloc.
Add the posix_memalign() function in all of its glory. Our new slab
allocator already does most of the job perfectly, particularly when
alignment < size (for things like cache-line aligned allocations).
Correct a bug in _vmem_alloc() for the case where (size) is much larger
then (alignment). The hack to get mmap() to return an aligned address
was not properly unmapping temporarily-mapped space.
Reformulate how errno is set to support posix_memalign(), which is defined
by the standard to return the error rather then set errno.
Requested-by: Hasso Tepper <hasso at estpak.ee>
Summary of changes:
include/stdlib.h | 1 +
lib/libc/stdlib/nmalloc.c | 119 ++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 112 insertions(+), 8 deletions(-)
DragonFly BSD source repository
More information about the Commits