diff options
-rw-r--r-- | compiler-rt/lib/scudo/scudo_allocator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/lib/scudo/scudo_allocator.cpp b/compiler-rt/lib/scudo/scudo_allocator.cpp index c72ac8601ba..5a9315e086f 100644 --- a/compiler-rt/lib/scudo/scudo_allocator.cpp +++ b/compiler-rt/lib/scudo/scudo_allocator.cpp @@ -197,16 +197,17 @@ struct QuarantineCallback { // that the batches are indeed serviced by the Primary. // TODO(kostyak): figure out the best way to protect the batches. void *Allocate(uptr Size) { + const uptr BatchClassId = SizeClassMap::ClassID(sizeof(QuarantineBatch)); return getBackendAllocator().allocatePrimary(Cache_, BatchClassId); } void Deallocate(void *Ptr) { + const uptr BatchClassId = SizeClassMap::ClassID(sizeof(QuarantineBatch)); getBackendAllocator().deallocatePrimary(Cache_, Ptr, BatchClassId); } AllocatorCache *Cache_; COMPILER_CHECK(sizeof(QuarantineBatch) < SizeClassMap::kMaxSize); - const uptr BatchClassId = SizeClassMap::ClassID(sizeof(QuarantineBatch)); }; typedef Quarantine<QuarantineCallback, void> ScudoQuarantine; |