diff options
author | Ömer Sinan Ağacan <omer@well-typed.com> | 2019-02-05 10:40:29 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-10-18 15:26:53 -0400 |
commit | 697be2b6908d926bf89fcc6cd173459e29022f51 (patch) | |
tree | 4bcf3a3027ad600a983a3976caa9e854c6292598 /includes/rts/storage | |
parent | c4c9904b324736dc5d190a91418e8d8f564d4104 (diff) | |
download | haskell-697be2b6908d926bf89fcc6cd173459e29022f51.tar.gz |
rts/GC: Add an obvious assertion during block initialization
Namely ensure that block descriptors are initialized with valid
generation numbers.
Co-Authored-By: Ben Gamari <ben@well-typed.com>
Diffstat (limited to 'includes/rts/storage')
-rw-r--r-- | includes/rts/storage/GC.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/rts/storage/GC.h b/includes/rts/storage/GC.h index 1571975852..77dbe60297 100644 --- a/includes/rts/storage/GC.h +++ b/includes/rts/storage/GC.h @@ -240,9 +240,17 @@ void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p); /* (needed when dynamic libraries are used). */ extern bool keepCAFs; +#include "rts/Flags.h" + INLINE_HEADER void initBdescr(bdescr *bd, generation *gen, generation *dest) { bd->gen = gen; bd->gen_no = gen->no; bd->dest_no = dest->no; + +#if !IN_STG_CODE + /* See Note [RtsFlags is a pointer in STG code] */ + ASSERT(gen->no < RtsFlags.GcFlags.generations); + ASSERT(dest->no < RtsFlags.GcFlags.generations); +#endif } |