1
0
mirror of https://github.com/CTCaer/hekate.git synced 2024-11-05 11:27:09 +00:00

heap: Add heap object copy

This commit is contained in:
CTCaer 2020-06-14 14:02:13 +03:00
parent 9489eca487
commit f5092bc981
4 changed files with 12 additions and 0 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);