added stub for pst_alloc_fini()
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -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_NONE = 0, // not initialized
|
||||||
ALLOC_HEAP = 1, // use libc memory allocator
|
ALLOC_HEAP = 1, // use libc memory allocator
|
||||||
ALLOC_CUSTOM // use custom allocator in predefined range of memory
|
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_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user