diff options
Diffstat (limited to 'src/daemon/memorypool.h')
-rw-r--r-- | src/daemon/memorypool.h | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/daemon/memorypool.h b/src/daemon/memorypool.h index 51f81674..3dfd4dcc 100644 --- a/src/daemon/memorypool.h +++ b/src/daemon/memorypool.h | |||
@@ -37,17 +37,22 @@ | |||
37 | */ | 37 | */ |
38 | struct MemoryPool; | 38 | struct MemoryPool; |
39 | 39 | ||
40 | |||
40 | /** | 41 | /** |
41 | * Create a memory pool. | 42 | * Create a memory pool. |
42 | * | 43 | * |
43 | * @param max maximum size of the pool | 44 | * @param max maximum size of the pool |
44 | */ | 45 | */ |
45 | struct MemoryPool *MHD_pool_create (size_t max); | 46 | struct MemoryPool * |
47 | MHD_pool_create (size_t max); | ||
48 | |||
46 | 49 | ||
47 | /** | 50 | /** |
48 | * Destroy a memory pool. | 51 | * Destroy a memory pool. |
49 | */ | 52 | */ |
50 | void MHD_pool_destroy (struct MemoryPool *pool); | 53 | void |
54 | MHD_pool_destroy (struct MemoryPool *pool); | ||
55 | |||
51 | 56 | ||
52 | /** | 57 | /** |
53 | * Allocate size bytes from the pool. | 58 | * Allocate size bytes from the pool. |
@@ -58,8 +63,10 @@ void MHD_pool_destroy (struct MemoryPool *pool); | |||
58 | * @return NULL if the pool cannot support size more | 63 | * @return NULL if the pool cannot support size more |
59 | * bytes | 64 | * bytes |
60 | */ | 65 | */ |
61 | void *MHD_pool_allocate (struct MemoryPool *pool, | 66 | void * |
62 | size_t size, int from_end); | 67 | MHD_pool_allocate (struct MemoryPool *pool, |
68 | size_t size, int from_end); | ||
69 | |||
63 | 70 | ||
64 | /** | 71 | /** |
65 | * Reallocate a block of memory obtained from the pool. | 72 | * Reallocate a block of memory obtained from the pool. |
@@ -77,10 +84,12 @@ void *MHD_pool_allocate (struct MemoryPool *pool, | |||
77 | * NULL if the pool cannot support new_size | 84 | * NULL if the pool cannot support new_size |
78 | * bytes (old continues to be valid for old_size) | 85 | * bytes (old continues to be valid for old_size) |
79 | */ | 86 | */ |
80 | void *MHD_pool_reallocate (struct MemoryPool *pool, | 87 | void * |
81 | void *old, | 88 | MHD_pool_reallocate (struct MemoryPool *pool, |
82 | size_t old_size, | 89 | void *old, |
83 | size_t new_size); | 90 | size_t old_size, |
91 | size_t new_size); | ||
92 | |||
84 | 93 | ||
85 | /** | 94 | /** |
86 | * Clear all entries from the memory pool except | 95 | * Clear all entries from the memory pool except |
@@ -90,8 +99,9 @@ void *MHD_pool_reallocate (struct MemoryPool *pool, | |||
90 | * @param size how many bytes need to be kept at this address | 99 | * @param size how many bytes need to be kept at this address |
91 | * @return addr new address of "keep" (if it had to change) | 100 | * @return addr new address of "keep" (if it had to change) |
92 | */ | 101 | */ |
93 | void *MHD_pool_reset (struct MemoryPool *pool, | 102 | void * |
94 | void *keep, | 103 | MHD_pool_reset (struct MemoryPool *pool, |
95 | size_t size); | 104 | void *keep, |
105 | size_t size); | ||
96 | 106 | ||
97 | #endif | 107 | #endif |