7 Commits

Author SHA1 Message Date
Jin Xin Ng
7639265af4
[sanitizer] Implement __sanitizer_get_allocated_size_fast
The primary motivation for this change is to allow FreeHooks to obtain
the allocated size of the pointer being freed in a fast, efficient manner.

Differential Revision: https://reviews.llvm.org/D151360
2023-05-26 00:19:47 +00:00
Vitaly Buka
d9b574c312 [hwasan] Fix allocator_interface implementation
__sanitizer_get_current_allocated_bytes had as body, but allocator
caches were not registered to collect stats. It's done by
SizeClassAllocator64LocalCache::Init().

Reviewed By: thurston

Differential Revision: https://reviews.llvm.org/D151389
2023-05-24 18:05:42 -07:00
Vitaly Buka
c46bc0d3e7 [lsan] Fix allocator_interface implementation
__sanitizer_get_current_allocated_bytes had as body, but allocator
caches were not registered to collect stats. It's done by
SizeClassAllocator64LocalCache::Init().

Reviewed By: thurston

Differential Revision: https://reviews.llvm.org/D151355
2023-05-24 13:27:23 -07:00
Vitaly Buka
d39d93288e [NFC] New line in test 2023-05-24 10:56:05 -07:00
Vitaly Buka
4305f640f0 [msan] Implement __sanitizer_get_current_allocated_bytes
__sanitizer_get_current_allocated_bytes had as body, but allocator
caches were not registered to collect stats. It's done by
SizeClassAllocator64LocalCache::Init().

Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D151352
2023-05-24 10:50:32 -07:00
Vitaly Buka
747704e34f [tsan] Implement __sanitizer_purge_allocator 2023-05-24 10:21:22 -07:00
Vitaly Buka
2fd4eca161 [sanitizer] Add allocator_interface test
Hooks are in malloc_hook.cpp.
2023-05-24 08:31:58 -07:00