diff options
Diffstat (limited to 'standalone/local_cache.h')
-rw-r--r-- | standalone/local_cache.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/standalone/local_cache.h b/standalone/local_cache.h index f46645f9bad..50039379fa0 100644 --- a/standalone/local_cache.h +++ b/standalone/local_cache.h @@ -49,14 +49,18 @@ template <class SizeClassAllocator> struct SizeClassAllocatorLocalCache { CompactPtrT Batch[MaxNumCached]; }; - void init(GlobalStats *S, SizeClassAllocator *A) { - DCHECK(isEmpty()); - Stats.init(); + void initLinkerInitialized(GlobalStats *S, SizeClassAllocator *A) { + Stats.initLinkerInitialized(); if (LIKELY(S)) S->link(&Stats); Allocator = A; } + void init(GlobalStats *S, SizeClassAllocator *A) { + memset(this, 0, sizeof(*this)); + initLinkerInitialized(S, A); + } + void destroy(GlobalStats *S) { drain(); if (LIKELY(S)) |