diff --git a/bootloader/mem/heap.c b/bootloader/mem/heap.c index 7c0e202..cafd806 100644 --- a/bootloader/mem/heap.c +++ b/bootloader/mem/heap.c @@ -128,6 +128,11 @@ void heap_init(u32 base) _heap_create(&_heap, base); } +void heap_copy(heap_t *heap) +{ + memcpy(&_heap, heap, sizeof(heap_t)); +} + void *malloc(u32 size) { return (void *)_heap_alloc(&_heap, size); diff --git a/bootloader/mem/heap.h b/bootloader/mem/heap.h index e029597..05faee2 100644 --- a/bootloader/mem/heap.h +++ b/bootloader/mem/heap.h @@ -22,6 +22,7 @@ #include "../../common/common_heap.h" void heap_init(u32 base); +void heap_copy(heap_t *heap); void *malloc(u32 size); void *calloc(u32 num, u32 size); void free(void *buf); diff --git a/nyx/nyx_gui/mem/heap.c b/nyx/nyx_gui/mem/heap.c index def827d..7b58e96 100644 --- a/nyx/nyx_gui/mem/heap.c +++ b/nyx/nyx_gui/mem/heap.c @@ -128,6 +128,11 @@ void heap_init(u32 base) _heap_create(&_heap, base); } +void heap_copy(heap_t *heap) +{ + memcpy(&_heap, heap, sizeof(heap_t)); +} + void *malloc(u32 size) { return (void *)_heap_alloc(&_heap, size); diff --git a/nyx/nyx_gui/mem/heap.h b/nyx/nyx_gui/mem/heap.h index 25c7c81..d6a7e5e 100644 --- a/nyx/nyx_gui/mem/heap.h +++ b/nyx/nyx_gui/mem/heap.h @@ -22,6 +22,7 @@ #include "../../../common/common_heap.h" void heap_init(u32 base); +void heap_copy(heap_t *heap); void *malloc(u32 size); void *calloc(u32 num, u32 size); void free(void *buf);