aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/memorypool.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/memorypool.c')
-rw-r--r--src/daemon/memorypool.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/daemon/memorypool.c b/src/daemon/memorypool.c
index 1bb12bae..e58cab38 100644
--- a/src/daemon/memorypool.c
+++ b/src/daemon/memorypool.c
@@ -191,24 +191,21 @@ MHD_pool_reallocate (struct MemoryPool *pool,
191/** 191/**
192 * Clear all entries from the memory pool except 192 * Clear all entries from the memory pool except
193 * for "keep" of the given "size". 193 * for "keep" of the given "size".
194 * 194 *
195 * @param keep pointer to the entry to keep (maybe NULL) 195 * @param keep pointer to the entry to keep (maybe NULL)
196 * @param size how many bytes need to be kept at this address 196 * @param size how many bytes need to be kept at this address
197 * @return addr new address of "keep" (if it had to change) 197 * @return addr new address of "keep" (if it had to change)
198 */ 198 */
199void *MHD_pool_reset(struct MemoryPool * pool, 199void *
200 void * keep, 200MHD_pool_reset (struct MemoryPool *pool, void *keep, unsigned int size)
201 unsigned int size)
202{ 201{
203 if (keep != NULL) 202 if (keep != NULL)
204 { 203 {
205 if (keep != pool->memory) 204 if (keep != pool->memory)
206 { 205 {
207 memmove(pool->memory, 206 memmove (pool->memory, keep, size);
208 keep, 207 keep = pool->memory;
209 size); 208 }
210 keep = pool->memory;
211 }
212 pool->pos = size; 209 pool->pos = size;
213 } 210 }
214 pool->end = pool->size; 211 pool->end = pool->size;