From 191a5a31c7b0700cafa804eedbe8cd50e678dc19 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 8 Nov 2023 09:08:10 -0500 Subject: [PATCH] add CIRCUITPY-CHANGE annotations --- py/gc.c | 1 + py/gc.h | 1 + 2 files changed, 2 insertions(+) diff --git a/py/gc.c b/py/gc.c index b333c517d4..dcf07c6467 100644 --- a/py/gc.c +++ b/py/gc.c @@ -363,6 +363,7 @@ bool gc_is_locked(void) { return MP_STATE_THREAD(gc_lock_depth) != 0; } +// CIRCUITPY-CHANGE bool gc_ptr_on_heap(void *ptr) { for (mp_state_mem_area_t *area = &MP_STATE_MEM(area); area != NULL; area = NEXT_AREA(area)) { if (ptr >= (void *)area->gc_pool_start // must be above start of pool diff --git a/py/gc.h b/py/gc.h index 6a2a4856e3..22b958980f 100644 --- a/py/gc.h +++ b/py/gc.h @@ -85,6 +85,7 @@ void *gc_realloc(void *ptr, size_t n_bytes, bool allow_move); // very sparingly because it can leak memory. bool gc_never_free(void *ptr); +// CIRCUITPY-CHANGE // True if the pointer is on the MP heap. Doesn't require that it is the start // of a block. bool gc_ptr_on_heap(void *ptr);