[PATCH] D122260: [memprof] Initialize MemInfoBlock data.

Snehasish Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 14:31:16 PDT 2022


snehasish added a comment.

PTAl, thanks!



================
Comment at: compiler-rt/include/profile/MemProfData.inc:125
       NumLifetimeOverlaps(0), NumSameAllocCpu(0),
-      NumSameDeallocCpu(0) {
+      NumSameDeallocCpu(0), DataTypeId(0) {
   NumMigratedCpu = AllocCpuId != DeallocCpuId;
----------------
tejohnson wrote:
> What if this constructor also did the same default initialization as the no-arg constructor, then overwrote the fields given by argument? That way we would not have missed initializations like this if the fields change.
Good idea, we can delegate to the default constructor and only initialize the necessary fields. Also took the opportunity to clean up the snake case arg names to be consistent with the rest of the surrounding code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122260/new/

https://reviews.llvm.org/D122260



More information about the llvm-commits mailing list