Skip to content

Commit

Permalink
[Memprof] Changes HISTOGRAM_GRANULARITY from 8U to 8ULL. (llvm#100949)
Browse files Browse the repository at this point in the history
This changes a bug in memprofiling with histogram where the shadow mask
would be `0xFFFFFFF8` instead of `0xFFFFFFFFFFFFFFF8`, essentially
discarding the upper 32 bits of the address. This can cause different
addresses to be mapped to the same shadow address.
  • Loading branch information
mattweingarten authored Jul 29, 2024
1 parent 7b99b1d commit 2a612a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler-rt/lib/memprof/memprof_mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extern uptr kHighMemEnd; // Initialized in __memprof_init.
// computed by summing up all individual 1 byte counters. This can incur an
// accuracy penalty.

#define HISTOGRAM_GRANULARITY 8U
#define HISTOGRAM_GRANULARITY 8ULL

#define HISTOGRAM_MAX_COUNTER 255U

Expand Down

0 comments on commit 2a612a1

Please sign in to comment.