diff --git a/c/malloc_speed_test/pool_list.c b/c/malloc_speed_test/pool_list.c index 1e12710..c02f9e7 100644 --- a/c/malloc_speed_test/pool_list.c +++ b/c/malloc_speed_test/pool_list.c @@ -2,7 +2,6 @@ #include -#define bool char #define TRUE 1 #define FALSE 0 @@ -50,6 +49,9 @@ void pool_init(struct block_pool *bp, size_t nblocks) bp->busy_pool = NULL; } +/* + * уничтожение пула + */ void pool_destroy(struct block_pool *bp) { free(bp->pool); @@ -57,6 +59,9 @@ void pool_destroy(struct block_pool *bp) bp->pool = bp->free_pool = bp->busy_pool = NULL; } +/* + * выдача блока из пула + */ void *pool_alloc(struct block_pool *bp) { if (!bp->free_pool) @@ -78,6 +83,9 @@ void *pool_alloc(struct block_pool *bp) return &bp->busy_pool->obj; } +/* + * возвращение блока в пул + */ void pool_free(struct block_pool *bp, void *p) { if (!p)