forked from OSchip/llvm-project
[NFC][Asan] Set AP32::kMetadataSize to 0
Asan does not use metadata with primary allocators. It should match AP64::kMetadataSize whic is 0. Depends on D86917. Reviewed By: morehouse Differential Revision: https://reviews.llvm.org/D86919
This commit is contained in:
parent
8b8be6f38a
commit
2b71b7f791
|
@ -171,7 +171,7 @@ template <typename AddressSpaceViewTy>
|
|||
struct AP32 {
|
||||
static const uptr kSpaceBeg = 0;
|
||||
static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE;
|
||||
static const uptr kMetadataSize = 16;
|
||||
static const uptr kMetadataSize = 0;
|
||||
typedef __asan::SizeClassMap SizeClassMap;
|
||||
static const uptr kRegionSizeLog = 20;
|
||||
using AddressSpaceView = AddressSpaceViewTy;
|
||||
|
|
|
@ -153,6 +153,7 @@ class SizeClassAllocator32 {
|
|||
}
|
||||
|
||||
void *GetMetaData(const void *p) {
|
||||
CHECK(kMetadataSize);
|
||||
CHECK(PointerIsMine(p));
|
||||
uptr mem = reinterpret_cast<uptr>(p);
|
||||
uptr beg = ComputeRegionBeg(mem);
|
||||
|
|
|
@ -230,6 +230,7 @@ class SizeClassAllocator64 {
|
|||
static uptr ClassID(uptr size) { return SizeClassMap::ClassID(size); }
|
||||
|
||||
void *GetMetaData(const void *p) {
|
||||
CHECK(kMetadataSize);
|
||||
uptr class_id = GetSizeClass(p);
|
||||
uptr size = ClassIdToSize(class_id);
|
||||
uptr chunk_idx = GetChunkIdx(reinterpret_cast<uptr>(p), size);
|
||||
|
|
Loading…
Reference in New Issue