py/gc: Fix debug printing of GC layout.
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
d75ff42297
commit
ab0258fb1e
14
py/gc.c
14
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
|
||||
|
|
Loading…
Reference in New Issue