Home | History | Annotate | Download | only in asan

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
52 // The memory chunk allocated from the underlying allocator looks like this:
99 // Every chunk of memory allocated by this allocator can be in one of 3 states:
148 // Clear the magic value, as allocator internals may overwrite the
224 struct Allocator {
230 AsanAllocator allocator;
242 explicit Allocator(LinkerInitialized)
265 allocator.Init(options.may_return_null);
270 allocator.SetMayReturnNull(options.may_return_null);
278 options->may_return_null = allocator.MayReturnNull();
349 // If we are allocating from the secondary allocator, there will be no
359 return allocator.ReturnNullOrDie();
368 allocator.Allocate(cache, needed_size, 8, false, check_rss_limit);
373 allocator.Allocate(cache, needed_size, 8, false, check_rss_limit);
377 return allocator.ReturnNullOrDie();
380 // Heap poisoning is enabled, but the allocator provides an unpoisoned
384 uptr allocated_size = allocator.GetActuallyAllocatedSize(allocated);
413 CHECK(allocator.FromPrimary(allocated));
415 CHECK(!allocator.FromPrimary(allocated));
417 uptr *meta = reinterpret_cast<uptr *>(allocator.GetMetaData(allocated));
566 return allocator.ReturnNullOrDie();
568 // If the memory comes from the secondary allocator no need to clear it
570 if (ptr && allocator.FromPrimary(ptr))
585 allocator.SwallowCache(ac);
590 // Assumes alloc_beg == allocator.GetBlockBegin(alloc_beg).
593 if (!allocator.FromPrimary(alloc_beg)) {
594 uptr *meta = reinterpret_cast<uptr *>(allocator.GetMetaData(alloc_beg));
605 void *alloc_beg = allocator.GetBlockBegin(reinterpret_cast<void *>(p));
609 // Allocator must be locked when this function is called.
612 allocator.GetBlockBeginFastLocked(reinterpret_cast<void *>(p));
645 allocator.PrintStats();
649 allocator.ForceLock();
655 allocator.ForceUnlock();
659 static Allocator instance(LINKER_INITIALIZED);
662 return instance.allocator;
796 instance.allocator.SetRssLimitIsExceeded(exceeded);
888 // ASan allocator doesn't reserve extra bytes, so normally we would