DragonFly BSD
DragonFly commits List (threaded) for 2012-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: kmalloc: Add kmalloc_powerof2() and kmalloc_cachealign()


From: Sepherosa Ziehau <sephe@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 6 Oct 2012 21:42:16 -0700 (PDT)

commit 55126ffeefe32fac458f727ce228b9ea3320ac6a
Author: Sepherosa Ziehau <sephe@dragonflybsd.org>
Date:   Sun Oct 7 12:14:52 2012 +0800

    kmalloc: Add kmalloc_powerof2() and kmalloc_cachealign()
    
    kmalloc_powerof2()
        Ensures that the returned address will be power of 2 aligned.
    
    kmalloc_cachealign()
        Ensures that the returned address will be cacheline size aligned.
        It is useful to allocate structs declared with __cachealign
        attribute.
    
    These two function probably should _not_ be used on the hot code path
    due to the computational cost to find the nearest power of 2 size.

Summary of changes:
 sys/kern/kern_slaballoc.c |   18 ++++++++++++++++++
 sys/sys/malloc.h          |    4 ++++
 2 files changed, 22 insertions(+), 0 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/55126ffeefe32fac458f727ce228b9ea3320ac6a


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]