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

git: libc -- dmalloc: Call malloc_init as-needed, rather than via cc constructor.


From: Venkatesh Srinivas <vsrinivas@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 20 May 2012 07:26:14 -0700 (PDT)

commit e12d3396c777165504d60d2a1408dcd7cb63660d
Author: Venkatesh Srinivas <me@endeavour.zapto.org>
Date:   Sun May 20 07:10:56 2012 -0700

    libc -- dmalloc: Call malloc_init as-needed, rather than via cc constructor.
    
    dmalloc requires its own _nmalloc_thr_init be called before it can service
    allocations. Applications with preinit arrays were able to call malloc before
    constructors ran, which caused them to crash on uninitialized allocator state.
    
    The change uses a flag to test for allocator init state. It is also careful
    to not allow _nmalloc_thr_init to be called recursively from within pthread
    initialization (slglobal.masked).
    
    Reported-by: marino@
    Closes-bug: 2305

Summary of changes:
 lib/libc/stdlib/dmalloc.c |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

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


-- 
DragonFly BSD source repository



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