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
83 SecondaryAllocator> Allocator;
94 static Allocator allocator;
102 // Every chunk of memory allocated by this allocator can be in one of 3 states:
140 // The memory chunk allocated from the underlying allocator looks like this:
192 return *reinterpret_cast<uptr *>(allocator.GetMetaData(AllocBeg()));
196 return allocator.GetBlockBegin(reinterpret_cast<void *>(this));
283 // Clear the magic value, as allocator internals may overwrite the
294 allocator.Deallocate(cache_, p);
298 return allocator.Allocate(cache_, size, 1, false);
302 allocator.Deallocate(cache_, p);
309 allocator.Init();
338 // If we are allocating from the secondary allocator, there will be no
355 allocated = allocator.Allocate(cache, needed_size, 8, false);
359 allocated = allocator.Allocate(cache, needed_size, 8, false);
386 CHECK(allocator.FromPrimary(allocated));
388 CHECK(!allocator.FromPrimary(allocated));
390 uptr *meta = reinterpret_cast<uptr *>(allocator.GetMetaData(allocated));
534 // Assumes alloc_beg == allocator.GetBlockBegin(alloc_beg).
537 if (!allocator.FromPrimary(alloc_beg)) {
538 uptr *meta = reinterpret_cast<uptr *>(allocator.GetMetaData(alloc_beg));
549 void *alloc_beg = allocator.GetBlockBegin(reinterpret_cast<void *>(p));
553 // Allocator must be locked when this function is called.
556 allocator.GetBlockBeginFastLocked(reinterpret_cast<void *>(p));
615 allocator.SwallowCache(GetAllocatorCache(this));
619 allocator.PrintStats();
641 // If the memory comes from the secondary allocator no need to clear it
643 if (ptr && allocator.FromPrimary(ptr))
695 allocator.ForceLock();
701 allocator.ForceUnlock();
709 __asan::allocator.ForceLock();
713 __asan::allocator.ForceUnlock();
717 *begin = (uptr)&__asan::allocator;
718 *end = *begin + sizeof(__asan::allocator);
768 __asan::allocator.ForEachChunk(callback, arg);
789 // ASan allocator doesn't reserve extra bytes, so normally we would