Skip to content

Commit dc277f0

Browse files
committed
fix HEAP_PTR macro
1 parent 36371fe commit dc277f0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

py/gc.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,19 @@
3434
#include "py/mpstate.h"
3535
#include "py/misc.h"
3636

37+
#if !MICROPY_GC_SPLIT_HEAP
3738
#define HEAP_PTR(ptr) ( \
38-
MP_STATE_MEM(gc_pool_start) != 0 /* Not on the heap if it isn't inited */ \
39-
&& ptr >= (void *)MP_STATE_MEM(gc_pool_start) /* must be above start of pool */ \
40-
&& ptr < (void *)MP_STATE_MEM(gc_pool_end) /* must be below end of pool */ \
39+
MP_STATE_MEM(area).gc_pool_start != 0 /* Not on the heap if it isn't inited */ \
40+
&& ptr >= (void *)MP_STATE_MEM(area).gc_pool_start /* must be above start of pool */ \
41+
&& ptr < (void *)MP_STATE_MEM(area).gc_pool_end /* must be below end of pool */ \
4142
)
4243

4344
// ptr should be of type void*
4445
#define VERIFY_PTR(ptr) ( \
4546
((uintptr_t)(ptr) & (MICROPY_BYTES_PER_GC_BLOCK - 1)) == 0 /* must be aligned on a block */ \
4647
&& HEAP_PTR(ptr) \
4748
)
49+
#endif
4850

4951
void gc_init(void *start, void *end);
5052
void gc_deinit(void);

0 commit comments

Comments
 (0)