38 |
void pool_destroy (struct pool *); |
void pool_destroy (struct pool *); |
39 |
void pool_clear (struct pool *); |
void pool_clear (struct pool *); |
40 |
|
|
41 |
|
/* Creates a pool, allocates an instance of the given STRUCT |
42 |
|
within it, sets the struct's MEMBER to the pool's address, and |
43 |
|
returns the allocated structure. */ |
44 |
|
#define pool_create_container(STRUCT, MEMBER) \ |
45 |
|
((STRUCT *) pool_create_at_offset (sizeof (STRUCT), \ |
46 |
|
offsetof (STRUCT, MEMBER))) |
47 |
|
void *pool_create_at_offset (size_t struct_size, size_t pool_member_offset); |
48 |
|
|
49 |
/* Suballocation routines. */ |
/* Suballocation routines. */ |
50 |
void *pool_alloc (struct pool *, size_t) MALLOC_LIKE; |
void *pool_alloc (struct pool *, size_t) MALLOC_LIKE; |
51 |
void *pool_nalloc (struct pool *, size_t n, size_t s) MALLOC_LIKE; |
void *pool_nalloc (struct pool *, size_t n, size_t s) MALLOC_LIKE; |
64 |
|
|
65 |
/* Gizmo allocations. */ |
/* Gizmo allocations. */ |
66 |
struct pool *pool_create_subpool (struct pool *); |
struct pool *pool_create_subpool (struct pool *); |
67 |
|
void pool_add_subpool (struct pool *, struct pool *subpool); |
68 |
FILE *pool_fopen (struct pool *, const char *, const char *); |
FILE *pool_fopen (struct pool *, const char *, const char *); |
69 |
int pool_fclose (struct pool *, FILE *); |
int pool_fclose (struct pool *, FILE *); |
70 |
|
|