// Set the custom hook
extent_hooks_ = *hooks;
extent_hooks_.alloc = &JemallocNodumpAllocator::alloc;
- if (auto ret =
- mallctl(key.c_str(), nullptr, nullptr, &hooks, sizeof(hooks))) {
+ extent_hooks_t* new_hooks = &extent_hooks_;
+ if (auto ret = mallctl(
+ key.c_str(), nullptr, nullptr, &new_hooks, sizeof(new_hooks))) {
LOG(FATAL) << "Unable to set the hooks: " << errnoStr(ret);
}
#endif
void* JemallocNodumpAllocator::alloc(
void* chunk,
#else
+extent_hooks_t JemallocNodumpAllocator::extent_hooks_;
extent_alloc_t* JemallocNodumpAllocator::original_alloc_ = nullptr;
void* JemallocNodumpAllocator::alloc(
extent_hooks_t* extent,
return *instance;
}
-} // folly
+} // namespace folly