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

git: libc - Do some reorganization of nmalloc() and add asserts.


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 9 Oct 2010 15:03:22 -0700 (PDT)

commit e58e48b4e24346fdda3691cc17bcd42522001399
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Sat Oct 9 14:47:47 2010 -0700

    libc - Do some reorganization of nmalloc() and add asserts.
    
    * Reorganize mtmagazine_alloc() and mtmagazine_free() to make the code
      more clear.  Add assertions on 'continue' loops so we abort on
      magazine memory corruption instead of looping forever.
    
    * Pre-stage the new magazine that mtmagazine_free() might need to avoid
      having to relock the depot.  This also allows us to stage the new
      magazine directory into the per-thread loaded field instead of running
      it through the depot.
    
    * Fix a deep or infinite recursion which can occur when mtmagazine_free()
      calls _slaballoc(), which it does sometimes when it needs a new
      magazine.  Avoid reentrancy by temporarily disabling the per-thread
      cache around the call.

Summary of changes:
 lib/libc/stdlib/nmalloc.c |  169 ++++++++++++++++++++++++++-------------------
 1 files changed, 99 insertions(+), 70 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e58e48b4e24346fdda3691cc17bcd42522001399


-- 
DragonFly BSD source repository



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