Skip to content

Commit 7ec7cd5

Browse files
[memprof] Fix IndexedMemProfRecord::clear
This patch ensures that IndexedMemProfRecord::clear clears every field of IndexedMemProfRecord. This fix is not critical at the moment. The only use of this function is in RecordWriterTrait::EmitData to release the memory we are done with. That is, we never clear the data structure for the purpose of reusing it.
1 parent 3845624 commit 7ec7cd5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/include/llvm/ProfileData/MemProf.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,10 @@ struct IndexedMemProfRecord {
416416
// the last entry in the list with the same function GUID.
417417
llvm::SmallVector<CallStackId> CallSiteIds;
418418

419-
void clear() { AllocSites.clear(); }
419+
void clear() {
420+
AllocSites.clear();
421+
CallSiteIds.clear();
422+
}
420423

421424
void merge(const IndexedMemProfRecord &Other) {
422425
// TODO: Filter out duplicates which may occur if multiple memprof

0 commit comments

Comments
 (0)