From f86b064fff1e29b94fa54e86aa5d8b2807ada1fd Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Sat, 30 Apr 2011 16:15:40 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D1=8B=20=D0=BA=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8F?= =?UTF-8?q?=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c/malloc_speed_test/pool_list.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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)