bool HwasanChunkView::IsAllocated() const {
return metadata_ && metadata_->alloc_context_id &&
- metadata_->get_requested_size();
+ metadata_->GetRequestedSize();
}
uptr HwasanChunkView::Beg() const {
return Beg() + UsedSize();
}
uptr HwasanChunkView::UsedSize() const {
- return metadata_->get_requested_size();
+ return metadata_->GetRequestedSize();
}
u32 HwasanChunkView::GetAllocStackId() const {
return metadata_->alloc_context_id;
}
Metadata *meta =
reinterpret_cast<Metadata *>(allocator.GetMetaData(allocated));
- meta->set_requested_size(orig_size);
+ meta->SetRequestedSize(orig_size);
meta->alloc_context_id = StackDepotPut(*stack);
if (zeroise) {
internal_memset(allocated, 0, size);
ReportInvalidFree(stack, reinterpret_cast<uptr>(tagged_ptr));
return;
}
- uptr orig_size = meta->get_requested_size();
+ uptr orig_size = meta->GetRequestedSize();
u32 free_context_id = StackDepotPut(*stack);
u32 alloc_context_id = meta->alloc_context_id;
orig_size, tail_magic);
}
- meta->set_requested_size(0);
+ meta->SetRequestedSize(0);
meta->alloc_context_id = 0;
// This memory will not be reused by anyone else, so we are free to keep it
// poisoned.
reinterpret_cast<Metadata *>(allocator.GetMetaData(untagged_ptr_old));
internal_memcpy(
UntagPtr(tagged_ptr_new), untagged_ptr_old,
- Min(new_size, static_cast<uptr>(meta->get_requested_size())));
+ Min(new_size, static_cast<uptr>(meta->GetRequestedSize())));
HwasanDeallocate(stack, tagged_ptr_old);
}
return tagged_ptr_new;
const void *beg = allocator.GetBlockBegin(untagged_ptr);
Metadata *b = (Metadata *)allocator.GetMetaData(untagged_ptr);
if (beg != untagged_ptr) return 0;
- return b->get_requested_size();
+ return b->GetRequestedSize();
}
void *hwasan_malloc(uptr size, StackTrace *stack) {