diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-11-29 16:42:51 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-11-29 16:42:51 +0000 |
commit | f9d15f9fccae4706fbdf8ee4ecaef7da9953cb74 (patch) | |
tree | ef79be277cf14c25b93739c420b7b2386f5562d4 /includes | |
parent | 9ca114a5840d8d00320e90c047022fa2ca1fa668 (diff) | |
download | haskell-f9d15f9fccae4706fbdf8ee4ecaef7da9953cb74.tar.gz |
Store a destination step in the block descriptor
At the moment, this just saves a memory reference in the GC inner loop
(worth a percent or two of GC time). Later, it will hopefully let me
experiment with partial steps, and simplifying the generation/step
infrastructure.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/rts/storage/Block.h | 32 | ||||
-rw-r--r-- | includes/rts/storage/GC.h | 7 |
2 files changed, 25 insertions, 14 deletions
diff --git a/includes/rts/storage/Block.h b/includes/rts/storage/Block.h index 849f99f430..e99a03e76c 100644 --- a/includes/rts/storage/Block.h +++ b/includes/rts/storage/Block.h @@ -48,22 +48,26 @@ #ifndef CMINUSMINUS typedef struct bdescr_ { - StgPtr start; /* start addr of memory */ - StgPtr free; /* first free byte of memory */ - struct bdescr_ *link; /* used for chaining blocks together */ - union { - struct bdescr_ *back; /* used (occasionally) for doubly-linked lists*/ - StgWord *bitmap; - StgPtr scan; /* scan pointer for copying GC */ - } u; - unsigned int gen_no; /* generation */ - struct step_ *step; /* step */ - StgWord32 blocks; /* no. of blocks (if grp head, 0 otherwise) */ - StgWord32 flags; /* block is in to-space */ + StgPtr start; /* start addr of memory */ + StgPtr free; /* first free byte of memory */ + struct bdescr_ *link; /* used for chaining blocks together */ + union { + struct bdescr_ *back; /* used (occasionally) for doubly-linked lists*/ + StgWord *bitmap; + StgPtr scan; /* scan pointer for copying GC */ + } u; + + struct step_ *step; /* step */ + struct step_ *dest; /* destination step */ + + StgWord32 blocks; /* no. of blocks (if grp head, 0 otherwise) */ + + StgWord16 gen_no; + StgWord16 flags; /* block flags, see below */ #if SIZEOF_VOID_P == 8 - StgWord32 _padding[2]; + StgWord32 _padding[2]; #else - StgWord32 _padding[0]; + StgWord32 _padding[0]; #endif } bdescr; #endif diff --git a/includes/rts/storage/GC.h b/includes/rts/storage/GC.h index b30582dfd7..aa0531382f 100644 --- a/includes/rts/storage/GC.h +++ b/includes/rts/storage/GC.h @@ -214,4 +214,11 @@ void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p); /* (needed when dynamic libraries are used). */ extern rtsBool keepCAFs; +INLINE_HEADER void initBdescr(bdescr *bd, step *step) +{ + bd->step = step; + bd->gen_no = step->gen_no; + bd->dest = step->to; +} + #endif /* RTS_STORAGE_GC_H */ |