Skip to content

Commit 4264b50

Browse files
committed
Merge pull request #12315 from JuliaLang/yyc/gc-oscar-ascii
Improve the comment in gc.c a little bit. [av skip]
2 parents ab2f418 + 51cbe02 commit 4264b50

File tree

1 file changed

+28
-21
lines changed

1 file changed

+28
-21
lines changed

src/gc.c

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ typedef struct _gcpage_t {
168168
#define REGION_COUNT 8
169169

170170
typedef struct {
171+
// Page layout:
172+
// Padding: GC_PAGE_OFFSET
173+
// Blocks: osize * n
174+
// Tag: sizeof_jl_taggedvalue_t
175+
// Data: <= osize - sizeof_jl_taggedvalue_t
171176
char pages[REGION_PG_COUNT][GC_PAGE_SZ]; // must be first, to preserve page alignment
172177
uint32_t freemap[REGION_PG_COUNT/32];
173178
gcpage_t meta[REGION_PG_COUNT];
@@ -449,29 +454,31 @@ static uint64_t total_fin_time=0;
449454
int sweeping = 0;
450455

451456
/*
452-
The state transition looks like :
453-
454-
<-[quicksweep]--
455-
<-[sweep]--- |
456-
| |
457-
---> GC_QUEUED <---[sweep && age>promotion]--------
458-
| | ^ |
459-
| [mark] | |
460-
[sweep] | [write barrier] |
461-
| v | |
462-
----- GC_MARKED <-------- |
463-
| | |
464-
--[quicksweep]-- |
465-
| === above this line objects are old
466-
----[new]------> GC_CLEAN ------[mark]--------> GC_MARKED_NOESC
467-
| ^ ^ | |
468-
| | | | |
469-
<---[sweep]-------- | ------[sweep && age<=promotion]--- |
470-
| |
471-
--[quicksweep && age<=promotion]------
457+
* The state transition looks like :
458+
*
459+
* ([(quick)sweep] means either a sweep or a quicksweep)
460+
*
461+
* <-[(quick)sweep]-
462+
* |
463+
* ---> GC_QUEUED <--[(quick)sweep && age>promotion]--
464+
* | | ^ |
465+
* | [mark] | |
466+
* [sweep] | [write barrier] |
467+
* | v | |
468+
* ----- GC_MARKED <-------- |
469+
* | | |
470+
* --[quicksweep]-- |
471+
* |
472+
* ========= above this line objects are old ========= |
473+
* |
474+
* ----[new]------> GC_CLEAN ------[mark]--------> GC_MARKED_NOESC
475+
* | ^ |
476+
* <-[(quick)sweep]--- | |
477+
* --[(quick)sweep && age<=promotion]---
472478
*/
473479

474-
// A quick sweep is a sweep where sweep_mask == GC_MARKED_NOESC. It means we won't touch GC_MARKED objects.
480+
// A quick sweep is a sweep where sweep_mask == GC_MARKED_NOESC.
481+
// It means we won't touch GC_MARKED objects (old gen).
475482

476483
// When a reachable object has survived more than PROMOTE_AGE+1 collections
477484
// it is tagged with GC_QUEUED during sweep and will be promoted on next mark

0 commit comments

Comments
 (0)