diff --git a/py/gc.c b/py/gc.c
index 7f2035668e58959c17bb2215a44a20e193ae49e4..bcdfc50954ff717bf68affdb06c050f0245bb8da 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -90,8 +90,8 @@ void gc_init(void *start, void *end) {
     }
 
     DEBUG_printf("GC layout:\n");
-    DEBUG_printf("  alloc table at %p, length %u bytes\n", gc_alloc_table_start, gc_alloc_table_byte_len);
-    DEBUG_printf("  pool at %p, length %u blocks = %u words = %u bytes\n", gc_pool_start, gc_pool_block_len, gc_pool_word_len, gc_pool_word_len * BYTES_PER_WORD);
+    DEBUG_printf("  alloc table at %p, length " UINT_FMT " bytes\n", gc_alloc_table_start, gc_alloc_table_byte_len);
+    DEBUG_printf("  pool at %p, length " UINT_FMT " blocks = " UINT_FMT " words = " UINT_FMT " bytes\n", gc_pool_start, gc_pool_block_len, gc_pool_word_len, gc_pool_word_len * BYTES_PER_WORD);
 }
 
 #define VERIFY_PTR(ptr) ( \
@@ -240,7 +240,7 @@ void gc_info(gc_info_t *info) {
 
 void *gc_alloc(machine_uint_t n_bytes) {
     machine_uint_t n_blocks = ((n_bytes + BYTES_PER_BLOCK - 1) & (~(BYTES_PER_BLOCK - 1))) / BYTES_PER_BLOCK;
-    DEBUG_printf("gc_alloc(%u bytes -> %u blocks)\n", n_bytes, n_blocks);
+    DEBUG_printf("gc_alloc(" UINT_FMT " bytes -> " UINT_FMT " blocks)\n", n_bytes, n_blocks);
 
     // check for 0 allocation
     if (n_blocks == 0) {
@@ -350,20 +350,25 @@ void gc_dump_info() {
            info.num_1block, info.num_2block, info.max_block);
 }
 
-#if DEBUG_PRINT
-STATIC void gc_dump_at(void) {
+void gc_dump_alloc_table(void) {
+    printf("GC memory layout:");
     for (machine_uint_t bl = 0; bl < gc_alloc_table_byte_len * BLOCKS_PER_ATB; bl++) {
-        printf("block %06u ", bl);
+        if (bl % 64 == 0) {
+            printf("\n%04x: ", (uint)bl);
+        }
+        int c = ' ';
         switch (ATB_GET_KIND(bl)) {
-            case AT_FREE: printf("FREE"); break;
-            case AT_HEAD: printf("HEAD"); break;
-            case AT_TAIL: printf("TAIL"); break;
-            default: printf("MARK"); break;
+            case AT_FREE: c = '.'; break;
+            case AT_HEAD: c = 'h'; break;
+            case AT_TAIL: c = 't'; break;
+            case AT_MARK: c = 'm'; break;
         }
-        printf("\n");
+        printf("%c", c);
     }
+    printf("\n");
 }
 
+#if DEBUG_PRINT
 void gc_test(void) {
     machine_uint_t len = 500;
     machine_uint_t *heap = malloc(len);
@@ -389,13 +394,13 @@ void gc_test(void) {
     }
 
     printf("Before GC:\n");
-    gc_dump_at();
+    gc_dump_alloc_table();
     printf("Starting GC...\n");
     gc_collect_start();
     gc_collect_root(ptrs, sizeof(ptrs) / sizeof(void*));
     gc_collect_end();
     printf("After GC:\n");
-    gc_dump_at();
+    gc_dump_alloc_table();
 }
 #endif
 
diff --git a/py/gc.h b/py/gc.h
index e5286cd861c6ac577058cea8b4175b0d47b64765..c8a1a996c34e5c57135998409598f21d6f2e91ff 100644
--- a/py/gc.h
+++ b/py/gc.h
@@ -19,3 +19,4 @@ typedef struct _gc_info_t {
 
 void gc_info(gc_info_t *info);
 void gc_dump_info(void);
+void gc_dump_alloc_table(void);
diff --git a/unix/gccollect.c b/unix/gccollect.c
index 60bc99323e195a739cae34ab19125c48b73445e3..5370a641ceff357740c31b52a4ac85ce23599c03 100644
--- a/unix/gccollect.c
+++ b/unix/gccollect.c
@@ -54,11 +54,11 @@ void gc_collect(void) {
     // this traces .data and .bss sections
     extern char __bss_start, _end;
     //printf(".bss: %p-%p\n", &__bss_start, &_end);
-    gc_collect_root((void**)&__bss_start, ((uint32_t)&_end - (uint32_t)&__bss_start) / sizeof(uint32_t));
+    gc_collect_root((void**)&__bss_start, ((machine_uint_t)&_end - (machine_uint_t)&__bss_start) / sizeof(machine_uint_t));
     regs_t regs;
     gc_helper_get_regs(regs);
     // GC stack (and regs because we captured them)
-    gc_collect_root((void**)&regs, ((uint32_t)stack_top - (uint32_t)&regs) / sizeof(uint32_t));
+    gc_collect_root((void**)&regs, ((machine_uint_t)stack_top - (machine_uint_t)&regs) / sizeof(machine_uint_t));
     gc_collect_end();
 
     //printf("-----\n");