summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_allocator_primary32.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-07-21 18:47:53 +0000
committerKostya Serebryany <kcc@google.com>2016-07-21 18:47:53 +0000
commit52ee88fd9cb9eaadfb9e8a6b460b57c2e25cb95d (patch)
tree53b75f77cfbcb754824b1bee3cc01a0934d72be1 /lib/sanitizer_common/sanitizer_allocator_primary32.h
parentc8da6db25e5e82ea0ce79615cdffdc4966e2900f (diff)
[sanitizer] allocator: remove kPopulateSize and only use SizeClassMap::MaxCached; ensure that TransferBatch size is a power of two, refactor TransferBatch creation/destruction into separate functions.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_allocator_primary32.h')
-rw-r--r--lib/sanitizer_common/sanitizer_allocator_primary32.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/sanitizer_common/sanitizer_allocator_primary32.h b/lib/sanitizer_common/sanitizer_allocator_primary32.h
index 7d4d027a7..4b4574c1e 100644
--- a/lib/sanitizer_common/sanitizer_allocator_primary32.h
+++ b/lib/sanitizer_common/sanitizer_allocator_primary32.h
@@ -231,10 +231,7 @@ class SizeClassAllocator32 {
Batch *b = nullptr;
for (uptr i = reg; i < reg + n_chunks * size; i += size) {
if (!b) {
- if (SizeClassMap::SizeClassRequiresSeparateTransferBatch(class_id))
- b = (Batch*)c->Allocate(this, SizeClassMap::ClassID(sizeof(Batch)));
- else
- b = (Batch*)i;
+ b = c->CreateBatch(class_id, this, (Batch*)i);
b->count = 0;
}
b->batch[b->count++] = (void*)i;