diff options
Diffstat (limited to 'includes/Cmm.h')
-rw-r--r-- | includes/Cmm.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/Cmm.h b/includes/Cmm.h index 574c60a1b3..fdb4badf9a 100644 --- a/includes/Cmm.h +++ b/includes/Cmm.h @@ -630,7 +630,11 @@ #else #define OVERWRITING_CLOSURE_SIZE(c, size) /* nothing */ #define OVERWRITING_CLOSURE(c) /* nothing */ -#define OVERWRITING_CLOSURE_MUTABLE(c, off) /* nothing */ +/* This is used to zero slop after shrunk arrays. It is important that we do + * this whenever profiling is enabled as described in Note [slop on the heap] + * in Storage.c. */ +#define OVERWRITING_CLOSURE_MUTABLE(c, off) \ + if (TO_W_(RtsFlags_ProfFlags_doHeapProfile(RtsFlags)) != 0) { foreign "C" overwritingMutableClosureOfs(c "ptr", off); } #endif // Memory barriers. |