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));
556 return allocator.ReturnNullOrDie();
558 // If the memory comes from the secondary allocator no need to clear it
560 if (ptr && allocator.FromPrimary(ptr))
575 allocator.SwallowCache(ac);
580 // Assumes alloc_beg == allocator.GetBlockBegin(alloc_beg).
583 if (!allocator.FromPrimary(alloc_beg)) {
584 uptr *meta = reinterpret_cast<uptr *>(allocator.GetMetaData(alloc_beg));
595 void *alloc_beg = allocator.GetBlockBegin(reinterpret_cast<void *>(p));
599 // Allocator must be locked when this function is called.
602 allocator.GetBlockBeginFastLocked(reinterpret_cast<void *>(p));
635 allocator.PrintStats();
639 allocator.ForceLock();
645 allocator.ForceUnlock();
649 static Allocator instance(LINKER_INITIALIZED);
652 return instance.allocator;
780 instance.allocator.SetRssLimitIsExceeded(exceeded);
872 // ASan allocator doesn't reserve extra bytes, so normally we would