Skip to content

Commit ee56d88

Browse files
committed
[HWASAN][NFC] Renamed [g|s]et_requested_size to [G|S]etRequestedSize.
Reviewed By: kda Differential Revision: https://reviews.llvm.org/D139727
1 parent 72b2ca5 commit ee56d88

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

compiler-rt/lib/hwasan/hwasan_allocator.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static ALIGNED(16) u8 tail_magic[kShadowAlignment - 1];
4343

4444
bool HwasanChunkView::IsAllocated() const {
4545
return metadata_ && metadata_->alloc_context_id &&
46-
metadata_->get_requested_size();
46+
metadata_->GetRequestedSize();
4747
}
4848

4949
uptr HwasanChunkView::Beg() const {
@@ -53,7 +53,7 @@ uptr HwasanChunkView::End() const {
5353
return Beg() + UsedSize();
5454
}
5555
uptr HwasanChunkView::UsedSize() const {
56-
return metadata_->get_requested_size();
56+
return metadata_->GetRequestedSize();
5757
}
5858
u32 HwasanChunkView::GetAllocStackId() const {
5959
return metadata_->alloc_context_id;
@@ -148,7 +148,7 @@ static void *HwasanAllocate(StackTrace *stack, uptr orig_size, uptr alignment,
148148
}
149149
Metadata *meta =
150150
reinterpret_cast<Metadata *>(allocator.GetMetaData(allocated));
151-
meta->set_requested_size(orig_size);
151+
meta->SetRequestedSize(orig_size);
152152
meta->alloc_context_id = StackDepotPut(*stack);
153153
if (zeroise) {
154154
internal_memset(allocated, 0, size);
@@ -234,7 +234,7 @@ static void HwasanDeallocate(StackTrace *stack, void *tagged_ptr) {
234234
ReportInvalidFree(stack, reinterpret_cast<uptr>(tagged_ptr));
235235
return;
236236
}
237-
uptr orig_size = meta->get_requested_size();
237+
uptr orig_size = meta->GetRequestedSize();
238238
u32 free_context_id = StackDepotPut(*stack);
239239
u32 alloc_context_id = meta->alloc_context_id;
240240

@@ -255,7 +255,7 @@ static void HwasanDeallocate(StackTrace *stack, void *tagged_ptr) {
255255
orig_size, tail_magic);
256256
}
257257

258-
meta->set_requested_size(0);
258+
meta->SetRequestedSize(0);
259259
meta->alloc_context_id = 0;
260260
// This memory will not be reused by anyone else, so we are free to keep it
261261
// poisoned.
@@ -312,7 +312,7 @@ static void *HwasanReallocate(StackTrace *stack, void *tagged_ptr_old,
312312
reinterpret_cast<Metadata *>(allocator.GetMetaData(untagged_ptr_old));
313313
internal_memcpy(
314314
UntagPtr(tagged_ptr_new), untagged_ptr_old,
315-
Min(new_size, static_cast<uptr>(meta->get_requested_size())));
315+
Min(new_size, static_cast<uptr>(meta->GetRequestedSize())));
316316
HwasanDeallocate(stack, tagged_ptr_old);
317317
}
318318
return tagged_ptr_new;
@@ -344,7 +344,7 @@ static uptr AllocationSize(const void *tagged_ptr) {
344344
const void *beg = allocator.GetBlockBegin(untagged_ptr);
345345
Metadata *b = (Metadata *)allocator.GetMetaData(untagged_ptr);
346346
if (beg != untagged_ptr) return 0;
347-
return b->get_requested_size();
347+
return b->GetRequestedSize();
348348
}
349349

350350
void *hwasan_malloc(uptr size, StackTrace *stack) {

compiler-rt/lib/hwasan/hwasan_allocator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ struct Metadata {
3434
u32 requested_size_low;
3535
u32 requested_size_high;
3636
u32 alloc_context_id;
37-
u64 get_requested_size() {
37+
u64 GetRequestedSize() {
3838
return (static_cast<u64>(requested_size_high) << 32) + requested_size_low;
3939
}
40-
void set_requested_size(u64 size) {
40+
void SetRequestedSize(u64 size) {
4141
requested_size_low = size & ((1ul << 32) - 1);
4242
requested_size_high = size >> 32;
4343
}

0 commit comments

Comments
 (0)