Commit 5fc76bd2 authored by Qi Wang's avatar Qi Wang Committed by Facebook Github Bot

Fix JemallocNodumpAllocator extent_hooks API.

Summary: Using extent_hooks mallctl to update hooks.

Reviewed By: jasone

Differential Revision: D5174623

fbshipit-source-id: 9313ee9ae55c85d973736077727e54a5825f4c3d
parent 3c118217
......@@ -89,7 +89,12 @@ bool JemallocNodumpAllocator::extend_and_setup_arena() {
}
// Set the custom hook
hooks->alloc = &JemallocNodumpAllocator::alloc;
extent_hooks_ = *hooks;
extent_hooks_.alloc = &JemallocNodumpAllocator::alloc;
if (auto ret =
mallctl(key.c_str(), nullptr, nullptr, &hooks, sizeof(hooks))) {
LOG(FATAL) << "Unable to set the hooks: " << errnoStr(ret);
}
#endif
return true;
......
......@@ -91,6 +91,7 @@ class JemallocNodumpAllocator {
static void* alloc(
void* chunk,
#else
extent_hooks_t extent_hooks_;
static extent_alloc_t* original_alloc_;
static void* alloc(
extent_hooks_t* extent,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment