summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2022-12-08 14:11:24 +1100
committerDamien George <damien@micropython.org>2022-12-08 14:36:34 +1100
commitab0258fb1ef58c7fcadd9e964921ab5adf89b443 (patch)
treef8ec46f778db444952bee5fa5bfa872a7cf1af4b /py
parentd75ff422972189232345108ecd2037ac148acda1 (diff)
py/gc: Fix debug printing of GC layout.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py')
-rw-r--r--py/gc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/py/gc.c b/py/gc.c
index 3c106fd67..22cfdae99 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -162,6 +162,13 @@ STATIC void gc_setup_area(mp_state_mem_area_t *area, void *start, void *end) {
#if MICROPY_GC_SPLIT_HEAP
area->next = NULL;
#endif
+
+ DEBUG_printf("GC layout:\n");
+ DEBUG_printf(" alloc table at %p, length " UINT_FMT " bytes, " UINT_FMT " blocks\n", MP_STATE_MEM(area).gc_alloc_table_start, MP_STATE_MEM(area).gc_alloc_table_byte_len, MP_STATE_MEM(area).gc_alloc_table_byte_len * BLOCKS_PER_ATB);
+ #if MICROPY_ENABLE_FINALISER
+ DEBUG_printf(" finaliser table at %p, length " UINT_FMT " bytes, " UINT_FMT " blocks\n", MP_STATE_MEM(area).gc_finaliser_table_start, gc_finaliser_table_byte_len, gc_finaliser_table_byte_len * BLOCKS_PER_FTB);
+ #endif
+ DEBUG_printf(" pool at %p, length " UINT_FMT " bytes, " UINT_FMT " blocks\n", MP_STATE_MEM(area).gc_pool_start, gc_pool_block_len * BYTES_PER_BLOCK, gc_pool_block_len);
}
void gc_init(void *start, void *end) {
@@ -191,13 +198,6 @@ void gc_init(void *start, void *end) {
#if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL
mp_thread_mutex_init(&MP_STATE_MEM(gc_mutex));
#endif
-
- DEBUG_printf("GC layout:\n");
- DEBUG_printf(" alloc table at %p, length " UINT_FMT " bytes, " UINT_FMT " blocks\n", MP_STATE_MEM(gc_alloc_table_start), MP_STATE_MEM(gc_alloc_table_byte_len), MP_STATE_MEM(gc_alloc_table_byte_len) * BLOCKS_PER_ATB);
- #if MICROPY_ENABLE_FINALISER
- DEBUG_printf(" finaliser table at %p, length " UINT_FMT " bytes, " UINT_FMT " blocks\n", MP_STATE_MEM(gc_finaliser_table_start), gc_finaliser_table_byte_len, gc_finaliser_table_byte_len * BLOCKS_PER_FTB);
- #endif
- DEBUG_printf(" pool at %p, length " UINT_FMT " bytes, " UINT_FMT " blocks\n", MP_STATE_MEM(gc_pool_start), gc_pool_block_len * BYTES_PER_BLOCK, gc_pool_block_len);
}
#if MICROPY_GC_SPLIT_HEAP