Lines Matching refs:allocator
12 // Implementation of ASan's memory allocator, 2-nd version.
13 // This variant uses the allocator from sanitizer_common, i.e. the one shared
60 static Allocator allocator;
68 // Every chunk of memory allocated by this allocator can be in one of 3 states:
107 // The memory chunk allocated from the underlying allocator looks like this:
160 allocator.GetMetaData(AllocBeg(locked_version)));
165 return allocator.GetBlockBeginFastLocked(
167 return allocator.GetBlockBegin(reinterpret_cast<void *>(this));
249 // Clear the magic value, as allocator internals may overwrite the
260 allocator.Deallocate(cache_, p);
264 return allocator.Allocate(cache_, size, 1, false);
268 allocator.Deallocate(cache_, p);
275 allocator.Init();
308 // If we are allocating from the secondary allocator, there will be no
325 allocated = allocator.Allocate(cache, needed_size, 8, false);
329 allocated = allocator.Allocate(cache, needed_size, 8, false);
333 // Heap poisoning is enabled, but the allocator provides an unpoisoned
337 uptr allocated_size = allocator.GetActuallyAllocatedSize(allocated);
366 CHECK(allocator.FromPrimary(allocated));
368 CHECK(!allocator.FromPrimary(allocated));
370 uptr *meta = reinterpret_cast<uptr *>(allocator.GetMetaData(allocated));
504 // Assumes alloc_beg == allocator.GetBlockBegin(alloc_beg).
507 if (!allocator.FromPrimary(alloc_beg)) {
508 uptr *meta = reinterpret_cast<uptr *>(allocator.GetMetaData(alloc_beg));
519 void *alloc_beg = allocator.GetBlockBegin(reinterpret_cast<void *>(p));
523 // Allocator must be locked when this function is called.
526 allocator.GetBlockBeginFastLocked(reinterpret_cast<void *>(p));
585 allocator.SwallowCache(GetAllocatorCache(this));
589 allocator.PrintStats();
609 // If the memory comes from the secondary allocator no need to clear it
611 if (ptr && allocator.FromPrimary(ptr))
663 allocator.ForceLock();
669 allocator.ForceUnlock();
677 __asan::allocator.ForceLock();
681 __asan::allocator.ForceUnlock();
685 *begin = (uptr)&__asan::allocator;
686 *end = *begin + sizeof(__asan::allocator);
741 __asan::allocator.ForEachChunk(callback, arg);
762 // ASan allocator doesn't reserve extra bytes, so normally we would