Skip to content

Commit 12ab9ed

Browse files
committed
py: Make heap printing compatible with 16-bit word size.
1 parent 3f327cc commit 12ab9ed

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

py/gc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,10 +680,11 @@ void gc_dump_alloc_table(void) {
680680
}
681681
}
682682
// print header for new line of blocks
683+
// (the cast to uint32_t is for 16-bit ports)
683684
#if EXTENSIVE_HEAP_PROFILING
684-
printf("\n%05x: ", (uint)(bl * BYTES_PER_BLOCK) & 0xfffff);
685+
printf("\n%05x: ", (uint)((bl * BYTES_PER_BLOCK) & (uint32_t)0xfffff));
685686
#else
686-
printf("\n%05x: ", (uint)PTR_FROM_BLOCK(bl) & 0xfffff);
687+
printf("\n%05x: ", (uint)(PTR_FROM_BLOCK(bl) & (uint32_t)0xfffff));
687688
#endif
688689
}
689690
int c = ' ';

0 commit comments

Comments
 (0)