diff --git a/src/system/libroot/posix/malloc_hoard2/arch-specific.cpp b/src/system/libroot/posix/malloc_hoard2/arch-specific.cpp index 688b602f6e..20f4cdf913 100644 --- a/src/system/libroot/posix/malloc_hoard2/arch-specific.cpp +++ b/src/system/libroot/posix/malloc_hoard2/arch-specific.cpp @@ -79,8 +79,6 @@ __init_after_fork(void) sHeapBase); exit(1); } - - hoardLockInit(sHeapLock, "heap"); } diff --git a/src/system/libroot/posix/malloc_hoard2/wrapper.cpp b/src/system/libroot/posix/malloc_hoard2/wrapper.cpp index c5e8c43c1a..acc0c80e9f 100644 --- a/src/system/libroot/posix/malloc_hoard2/wrapper.cpp +++ b/src/system/libroot/posix/malloc_hoard2/wrapper.cpp @@ -262,6 +262,8 @@ __heap_before_fork(void) static processHeap *pHeap = getAllocator(); for (int i = 0; i < pHeap->getMaxThreadHeaps(); i++) pHeap->getHeap(i).lock(); + + static_cast(pHeap)->lock(); } void __init_after_fork(void); @@ -273,6 +275,8 @@ __heap_after_fork_child(void) static processHeap *pHeap = getAllocator(); for (int i = 0; i < pHeap->getMaxThreadHeaps(); i++) pHeap->getHeap(i).initLock(); + + pHeap->initLock(); } @@ -282,6 +286,8 @@ __heap_after_fork_parent(void) static processHeap *pHeap = getAllocator(); for (int i = 0; i < pHeap->getMaxThreadHeaps(); i++) pHeap->getHeap(i).unlock(); + + static_cast(pHeap)->unlock(); }