added stub for pst_alloc_fini()

This commit is contained in:
2020-01-28 19:26:33 +04:00
parent e62db2210d
commit 097c0f93d3
2 changed files with 10 additions and 2 deletions
+6
View File
@@ -52,3 +52,9 @@ void pst_allocator_init_custom(pst_allocator& alloc, void* buff, uint32_t size)
return; return;
} }
void pst_alloc_fini(pst_allocator& alloc)
{
alloc.type = ALLOC_NONE;
alloc.base = NULL;
alloc.size = 0;
}
+4 -2
View File
@@ -18,8 +18,9 @@ typedef void (*pst_free_def)(pst_allocator& alloc, void* buff);
typedef void* (*pst_realloc_def)(pst_allocator& alloc, void* buff, uint32_t new_size); typedef void* (*pst_realloc_def)(pst_allocator& alloc, void* buff, uint32_t new_size);
typedef enum { typedef enum {
ALLOC_HEAP = 1, // use libc memory allocator ALLOC_NONE = 0, // not initialized
ALLOC_CUSTOM // use custom allocator in predefined range of memory ALLOC_HEAP = 1, // use libc memory allocator
ALLOC_CUSTOM = 2 // use custom allocator in predefined range of memory
} pst_alloc_type; } pst_alloc_type;
typedef struct __pst_allocator { typedef struct __pst_allocator {
@@ -34,5 +35,6 @@ typedef struct __pst_allocator {
void pst_alloc_init(pst_allocator& alloc); void pst_alloc_init(pst_allocator& alloc);
void pst_allocator_init_custom(pst_allocator& alloc, void* buff, uint32_t size); void pst_allocator_init_custom(pst_allocator& alloc, void* buff, uint32_t size);
void pst_alloc_fini(pst_allocator& alloc);
#endif /* FRAMEWORK_ALLOCATOR_H_ */ #endif /* FRAMEWORK_ALLOCATOR_H_ */