DragonFly- master include stdlib.h lib/libc/stdlib nmalloc.c

Matthew Dillon dillon at crater.dragonflybsd.org
Tue Apr 28 09:36:10 PDT 2009

commit 11e45f670654c8b84541cb74fbde240db9359143
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 mailing list