File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -195,14 +195,22 @@ bool gc_is_locked(void) {
195195 && ptr < (void*)MP_STATE_MEM(gc_pool_end) /* must be below end of pool */ \
196196 )
197197
198+ #ifndef TRACE_MARK
199+ #if DEBUG_PRINT
200+ #define TRACE_MARK (block , ptr ) DEBUG_printf("gc_mark(%p)\n", ptr)
201+ #else
202+ #define TRACE_MARK (block , ptr )
203+ #endif
204+ #endif
205+
198206// ptr should be of type void*
199207#define VERIFY_MARK_AND_PUSH (ptr ) \
200208 do { \
201209 if (VERIFY_PTR(ptr)) { \
202210 size_t _block = BLOCK_FROM_PTR(ptr); \
203211 if (ATB_GET_KIND(_block) == AT_HEAD) { \
204212 /* an unmarked head, mark it, and push it on gc stack */ \
205- DEBUG_printf ( "gc_mark(%p)\n" , ptr ); \
213+ TRACE_MARK ( _block , ptr ); \
206214 ATB_HEAD_TO_MARK (_block ); \
207215 if (MP_STATE_MEM (gc_sp ) < & MP_STATE_MEM (gc_stack )[MICROPY_ALLOC_GC_STACK_SIZE ]) { \
208216 * MP_STATE_MEM (gc_sp )++ = _block ; \
You can’t perform that action at this time.
0 commit comments