From 216afd1c92e4ac2d982a09226c27a626a66f8e56 Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Wed, 8 May 2024 00:51:55 +0200 Subject: [PATCH] snRuntime: Add `snrt_l1_update_next_v2()` used to free memory --- sw/snRuntime/src/alloc_v2.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sw/snRuntime/src/alloc_v2.h b/sw/snRuntime/src/alloc_v2.h index 9c1418c2b8..abe0f0765a 100644 --- a/sw/snRuntime/src/alloc_v2.h +++ b/sw/snRuntime/src/alloc_v2.h @@ -8,6 +8,13 @@ inline snrt_allocator_t *snrt_l1_allocator_v2() { return &l1_allocator_v2; } inline void *snrt_l1_next_v2() { return (void *)snrt_l1_allocator_v2()->next; } +/** + * @brief Override the L1 allocator next pointer + */ +inline void snrt_l1_update_next_v2(void *next) { + snrt_l1_allocator_v2()->next = (uint32_t)next; +} + // Check that allocation doesn't exceed allocator bounds, and raise an // exception otherwise inline void snrt_l1_alloc_check_bounds() {