comparison srf2fastq/io_lib-1.12.2/io_lib/pooled_alloc.h @ 0:d901c9f41a6a default tip

Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
author dawe
date Tue, 07 Jun 2011 17:48:05 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d901c9f41a6a
1 #ifndef _POOLED_ALLOC_H_
2 #define _POOLED_ALLOC_H_
3
4 /*
5 * Implements a pooled block allocator where all items are the same size,
6 * but we need many of them.
7 */
8 typedef struct {
9 void *pool;
10 size_t used;
11 } pool_t;
12
13 typedef struct {
14 size_t dsize;
15 size_t npools;
16 pool_t *pools;
17 void *free;
18 } pool_alloc_t;
19
20 pool_alloc_t *pool_create(size_t dsize);
21 void pool_destroy(pool_alloc_t *p);
22 void *pool_alloc(pool_alloc_t *p);
23 void pool_free(pool_alloc_t *p, void *ptr);
24
25
26 #endif /*_POOLED_ALLOC_H_*/