Skip to content

Commit fb2d946

Browse files
authored
ensure a few GC verify functions conform with the new page metadata layout (#52975)
Fix #52973.
1 parent d384a36 commit fb2d946

File tree

1 file changed

+9
-38
lines changed

1 file changed

+9
-38
lines changed

src/gc-debug.c

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -349,44 +349,15 @@ static void gc_verify_tags_page(jl_gc_pagemeta_t *pg)
349349
}
350350
}
351351

352-
static void gc_verify_tags_pagetable0(pagetable0_t *pagetable0)
353-
{
354-
for (int pg_i = 0; pg_i < REGION0_PG_COUNT / 32; pg_i++) {
355-
uint32_t line = pagetable0->allocmap[pg_i];
356-
if (line) {
357-
for (int j = 0; j < 32; j++) {
358-
if ((line >> j) & 1) {
359-
gc_verify_tags_page(pagetable0->meta[pg_i * 32 + j]);
360-
}
361-
}
362-
}
363-
}
364-
}
365-
366-
static void gc_verify_tags_pagetable1(pagetable1_t *pagetable1)
352+
static void gc_verify_tags_pagestack(void)
367353
{
368-
for (int pg_i = 0; pg_i < REGION1_PG_COUNT / 32; pg_i++) {
369-
uint32_t line = pagetable1->allocmap0[pg_i];
370-
if (line) {
371-
for (int j = 0; j < 32; j++) {
372-
if ((line >> j) & 1) {
373-
gc_verify_tags_pagetable0(pagetable1->meta0[pg_i * 32 + j]);
374-
}
375-
}
376-
}
377-
}
378-
}
379-
380-
static void gc_verify_tags_pagetable(void)
381-
{
382-
for (int pg_i = 0; pg_i < (REGION2_PG_COUNT + 31) / 32; pg_i++) {
383-
uint32_t line = memory_map.allocmap1[pg_i];
384-
if (line) {
385-
for (int j = 0; j < 32; j++) {
386-
if ((line >> j) & 1) {
387-
gc_verify_tags_pagetable1(memory_map.meta1[pg_i * 32 + j]);
388-
}
389-
}
354+
for (int i = 0; i < gc_n_threads; i++) {
355+
jl_ptls_t ptls2 = gc_all_tls_states[i];
356+
jl_gc_page_stack_t *pgstk = &ptls2->page_metadata_allocd;
357+
jl_gc_pagemeta_t *pg = jl_atomic_load_relaxed(&pgstk->bottom);
358+
while (pg != NULL) {
359+
gc_verify_tags_page(pg);
360+
pg = pg->next;
390361
}
391362
}
392363
}
@@ -423,7 +394,7 @@ void gc_verify_tags(void)
423394

424395
// verify that all the objects on every page are either valid julia objects
425396
// or are part of the freelist or are on the allocated half of a page
426-
gc_verify_tags_pagetable();
397+
gc_verify_tags_pagestack();
427398
}
428399
#endif
429400

0 commit comments

Comments
 (0)