forked from OSchip/llvm-project
parent
ae0fc23f8d
commit
50498e114f
|
@ -171,11 +171,9 @@ void *MsanReallocate(StackTrace *stack, void *old_p, uptr new_size,
|
||||||
}
|
}
|
||||||
|
|
||||||
static uptr AllocationSize(const void *p) {
|
static uptr AllocationSize(const void *p) {
|
||||||
if (p == 0)
|
if (p == 0) return 0;
|
||||||
return 0;
|
|
||||||
const void *beg = allocator.GetBlockBegin(p);
|
const void *beg = allocator.GetBlockBegin(p);
|
||||||
if (beg != p)
|
if (beg != p) return 0;
|
||||||
return 0;
|
|
||||||
Metadata *b = (Metadata *)allocator.GetMetaData(p);
|
Metadata *b = (Metadata *)allocator.GetMetaData(p);
|
||||||
return b->requested_size;
|
return b->requested_size;
|
||||||
}
|
}
|
||||||
|
@ -196,22 +194,12 @@ uptr __msan_get_heap_size() {
|
||||||
return stats[AllocatorStatMapped];
|
return stats[AllocatorStatMapped];
|
||||||
}
|
}
|
||||||
|
|
||||||
uptr __msan_get_free_bytes() {
|
uptr __msan_get_free_bytes() { return 1; }
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
uptr __msan_get_unmapped_bytes() {
|
uptr __msan_get_unmapped_bytes() { return 1; }
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
uptr __msan_get_estimated_allocated_size(uptr size) {
|
uptr __msan_get_estimated_allocated_size(uptr size) { return size; }
|
||||||
return size;
|
|
||||||
}
|
|
||||||
|
|
||||||
int __msan_get_ownership(const void *p) {
|
int __msan_get_ownership(const void *p) { return AllocationSize(p) != 0; }
|
||||||
return AllocationSize(p) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
uptr __msan_get_allocated_size(const void *p) {
|
uptr __msan_get_allocated_size(const void *p) { return AllocationSize(p); }
|
||||||
return AllocationSize(p);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue