summaryrefslogtreecommitdiff
path: root/supervisor/shared
diff options
context:
space:
mode:
Diffstat (limited to 'supervisor/shared')
-rwxr-xr-xsupervisor/shared/memory.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c
index 14c3b4979..51037bd6d 100755
--- a/supervisor/shared/memory.c
+++ b/supervisor/shared/memory.c
@@ -82,6 +82,15 @@ void free_memory(supervisor_allocation* allocation) {
allocation->ptr = NULL;
}
+supervisor_allocation* allocation_from_ptr(void *ptr) {
+ for (size_t index = 0; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index++) {
+ if (allocations[index].ptr == ptr) {
+ return &allocations[index];
+ }
+ }
+ return NULL;
+}
+
supervisor_allocation* allocate_remaining_memory(void) {
if (low_address == high_address) {
return NULL;