优化
This commit is contained in:
+9
-1
@@ -30,7 +30,7 @@ typedef struct {
|
||||
/* ------------------------------------------------------------------------------------------------------------------ */
|
||||
/* */
|
||||
|
||||
void pool_add_block(pool_t* self, void* block, os_size_t block_size);
|
||||
os_bool_t pool_add_block(pool_t* self, void* block, os_size_t block_size);
|
||||
|
||||
/*
|
||||
* pool_t pool;
|
||||
@@ -57,6 +57,14 @@ void pool_init(pool_t* self, os_size_t obj_size){
|
||||
self->capacity = 0;
|
||||
}
|
||||
|
||||
OS_STATIC_FORCE_INLINE
|
||||
void pool_destroy(pool_t* self){
|
||||
self->free_list_p = 0;
|
||||
self->obj_size = 0;
|
||||
self->count = 0;
|
||||
self->capacity = 0;
|
||||
}
|
||||
|
||||
OS_STATIC_FORCE_INLINE
|
||||
void* pool_alloc(pool_t* self){
|
||||
if(!self->free_list_p){
|
||||
|
||||
Reference in New Issue
Block a user