Skip to content

Commit 1ffadf9

Browse files
committed
Clean up GC macro mess; create gc.h
1 parent b9014fa commit 1ffadf9

File tree

3 files changed

+388
-388
lines changed

3 files changed

+388
-388
lines changed

src/gc-debug.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ JL_DLLEXPORT jl_taggedvalue_t *jl_gc_find_taggedvalue_pool(char *p, size_t *osiz
2222
// Not in the pool
2323
if (!r)
2424
return NULL;
25-
char *page_begin = GC_PAGE_DATA(p) + GC_PAGE_OFFSET;
25+
char *page_begin = gc_page_data(p) + GC_PAGE_OFFSET;
2626
// In the page header
2727
if (p < page_begin)
2828
return NULL;
@@ -38,7 +38,7 @@ JL_DLLEXPORT jl_taggedvalue_t *jl_gc_find_taggedvalue_pool(char *p, size_t *osiz
3838
return NULL;
3939
char *tag = (char*)p - ofs % osize;
4040
// Points to an "object" that gets into the next page
41-
if (tag + osize > GC_PAGE_DATA(p) + GC_PAGE_SZ)
41+
if (tag + osize > gc_page_data(p) + GC_PAGE_SZ)
4242
return NULL;
4343
if (osize_p)
4444
*osize_p = osize;
@@ -138,7 +138,7 @@ static void clear_mark(int bits)
138138
}
139139
bigval_t *v;
140140
FOR_EACH_HEAP () {
141-
v = big_objects;
141+
v = current_heap->big_objects;
142142
while (v != NULL) {
143143
void *gcv = &v->header;
144144
if (!verifying) arraylist_push(&bits_save[gc_bits(gcv)], gcv);
@@ -166,7 +166,7 @@ static void clear_mark(int bits)
166166
jl_gc_pagemeta_t *pg = page_metadata(region->pages[pg_i*32 + j].data + GC_PAGE_OFFSET);
167167
pool_t *pool;
168168
FOR_HEAP (pg->thread_n)
169-
pool = &pools[pg->pool_n];
169+
pool = &current_heap->norm_pools[pg->pool_n];
170170
pv = (gcval_t*)(pg->data + GC_PAGE_OFFSET);
171171
char *lim = (char*)pv + GC_PAGE_SZ - GC_PAGE_OFFSET - pool->osize;
172172
while ((char*)pv <= lim) {
@@ -379,7 +379,7 @@ void gc_debug_print_status(void)
379379
uint64_t other_count = jl_gc_debug_env.other.num;
380380
jl_safe_printf("Allocations: %" PRIu64 " "
381381
"(Pool: %" PRIu64 "; Other: %" PRIu64 "); GC: %d\n",
382-
pool_count + other_count, pool_count, other_count, n_pause);
382+
pool_count + other_count, pool_count, other_count, gc_num.pause);
383383
}
384384

385385
void gc_debug_critical_error(void)
@@ -415,7 +415,7 @@ static void gc_scrub_range(char *stack_lo, char *stack_hi)
415415
pg->allocd = 1;
416416
pg->gc_bits = 0x3;
417417
// Find the age bit
418-
char *page_begin = GC_PAGE_DATA(tag) + GC_PAGE_OFFSET;
418+
char *page_begin = gc_page_data(tag) + GC_PAGE_OFFSET;
419419
int obj_id = (((char*)tag) - page_begin) / osize;
420420
uint8_t *ages = pg->ages + obj_id / 8;
421421
// Force this to be a young object to save some memory
@@ -450,7 +450,7 @@ void gc_debug_print_status(void)
450450
uint64_t big_count = gc_num.bigalloc;
451451
jl_safe_printf("Allocations: %" PRIu64 " "
452452
"(Pool: %" PRIu64 "; Big: %" PRIu64 "); GC: %d\n",
453-
pool_count + big_count, pool_count, big_count, n_pause);
453+
pool_count + big_count, pool_count, big_count, gc_num.pause);
454454
}
455455

456456
void gc_debug_critical_error(void)

0 commit comments

Comments
 (0)