Skip to content

Commit e09245b

Browse files
[memprof] Fix typos in serializedSizeV0 and serializedSizeV2 (#88629)
The first field to serialize is the size of IndexedMemProfRecord::AllocSites. It has nothing to do with GlobalValue::GUID. This happens to work because of: using GUID = uint64_t;
1 parent 9dbb6e1 commit e09245b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/ProfileData/MemProf.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ size_t IndexedAllocationInfo::serializedSize(IndexedVersion Version) const {
4242
}
4343

4444
static size_t serializedSizeV0(const IndexedMemProfRecord &Record) {
45-
size_t Result = sizeof(GlobalValue::GUID);
45+
// The number of alloc sites to serialize.
46+
size_t Result = sizeof(uint64_t);
4647
for (const IndexedAllocationInfo &N : Record.AllocSites)
4748
Result += N.serializedSize(Version0);
4849

@@ -57,7 +58,8 @@ static size_t serializedSizeV0(const IndexedMemProfRecord &Record) {
5758
}
5859

5960
static size_t serializedSizeV2(const IndexedMemProfRecord &Record) {
60-
size_t Result = sizeof(GlobalValue::GUID);
61+
// The number of alloc sites to serialize.
62+
size_t Result = sizeof(uint64_t);
6163
for (const IndexedAllocationInfo &N : Record.AllocSites)
6264
Result += N.serializedSize(Version2);
6365

0 commit comments

Comments
 (0)