diff options
Diffstat (limited to 'libsanitizer/asan/asan_allocator.h')
-rw-r--r-- | libsanitizer/asan/asan_allocator.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/libsanitizer/asan/asan_allocator.h b/libsanitizer/asan/asan_allocator.h index 1f83dcd6780..763f4a58ef9 100644 --- a/libsanitizer/asan/asan_allocator.h +++ b/libsanitizer/asan/asan_allocator.h @@ -33,10 +33,11 @@ void InitializeAllocator(); class AsanChunkView { public: explicit AsanChunkView(AsanChunk *chunk) : chunk_(chunk) {} - bool IsValid() { return chunk_ != 0; } - uptr Beg(); // first byte of user memory. - uptr End(); // last byte of user memory. - uptr UsedSize(); // size requested by the user. + bool IsValid(); // Checks if AsanChunkView points to a valid allocated + // or quarantined chunk. + uptr Beg(); // First byte of user memory. + uptr End(); // Last byte of user memory. + uptr UsedSize(); // Size requested by the user. uptr AllocTid(); uptr FreeTid(); void GetAllocStack(StackTrace *stack); @@ -88,16 +89,12 @@ class AsanChunkFifoList: public IntrusiveList<AsanChunk> { }; struct AsanThreadLocalMallocStorage { - explicit AsanThreadLocalMallocStorage(LinkerInitialized x) - { } - AsanThreadLocalMallocStorage() { - CHECK(REAL(memset)); - REAL(memset)(this, 0, sizeof(AsanThreadLocalMallocStorage)); - } - uptr quarantine_cache[16]; uptr allocator2_cache[96 * (512 * 8 + 16)]; // Opaque. void CommitBack(); + private: + // These objects are allocated via mmap() and are zero-initialized. + AsanThreadLocalMallocStorage() {} }; void *asan_memalign(uptr alignment, uptr size, StackTrace *stack, @@ -112,7 +109,7 @@ void *asan_pvalloc(uptr size, StackTrace *stack); int asan_posix_memalign(void **memptr, uptr alignment, uptr size, StackTrace *stack); -uptr asan_malloc_usable_size(void *ptr, StackTrace *stack); +uptr asan_malloc_usable_size(void *ptr, uptr pc, uptr bp); uptr asan_mz_size(const void *ptr); void asan_mz_force_lock(); |