GNU libmicrohttpd  0.9.29
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
memorypool.h
Go to the documentation of this file.
1 /*
2  This file is part of libmicrohttpd
3  (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, int from_end);
74 
75 
93 void *
94 MHD_pool_reallocate (struct MemoryPool *pool,
95  void *old,
96  size_t old_size,
97  size_t new_size);
98 
99 
109 void *
110 MHD_pool_reset (struct MemoryPool *pool,
111  void *keep,
112  size_t size);
113 
114 #endif