add CIRCUITPY-CHANGE annotations
This commit is contained in:
parent
eb1b27431a
commit
191a5a31c7
1
py/gc.c
1
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
|
||||
|
1
py/gc.h
1
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);
|
||||
|
Loading…
Reference in New Issue
Block a user