GNU libmicrohttpd  0.9.29
memorypool.h
Go to the documentation of this file.
1 /*
2  This file is part of libmicrohttpd
3  Copyright (C) 2007, 2009 Daniel Pittman and Christian Grothoff
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
28 #ifndef MEMORYPOOL_H
29 #define MEMORYPOOL_H
30 
31 #include "internal.h"
32 
38 struct MemoryPool;
39 
40 
47 struct MemoryPool *
48 MHD_pool_create (size_t max);
49 
50 
56 void
57 MHD_pool_destroy (struct MemoryPool *pool);
58 
59 
71 void *
72 MHD_pool_allocate (struct MemoryPool *pool,
73  size_t size,
74  int from_end);
75 
76 
94 void *
95 MHD_pool_reallocate (struct MemoryPool *pool,
96  void *old,
97  size_t old_size,
98  size_t new_size);
99 
100 
107 size_t
108 MHD_pool_get_free (struct MemoryPool *pool);
109 
110 
124 void *
125 MHD_pool_reset (struct MemoryPool *pool,
126  void *keep,
127  size_t copy_bytes,
128  size_t new_size);
129 
130 #endif
size_t MHD_pool_get_free(struct MemoryPool *pool)
Definition: memorypool.c:170
void MHD_pool_destroy(struct MemoryPool *pool)
Definition: memorypool.c:142
struct MemoryPool * MHD_pool_create(size_t max)
Definition: memorypool.c:87
internal shared structures
void * MHD_pool_allocate(struct MemoryPool *pool, size_t size, int from_end)
Definition: memorypool.c:188
void * MHD_pool_reallocate(struct MemoryPool *pool, void *old, size_t old_size, size_t new_size)
Definition: memorypool.c:233
void * MHD_pool_reset(struct MemoryPool *pool, void *keep, size_t copy_bytes, size_t new_size)
Definition: memorypool.c:299