GNU libmicrohttpd  0.9.5
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 
45 struct MemoryPool *MHD_pool_create (size_t max);
46 
50 void MHD_pool_destroy (struct MemoryPool *pool);
51 
61 void *MHD_pool_allocate (struct MemoryPool *pool,
62  size_t size, int from_end);
63 
80 void *MHD_pool_reallocate (struct MemoryPool *pool,
81  void *old,
82  size_t old_size,
83  size_t new_size);
84 
93 void *MHD_pool_reset (struct MemoryPool *pool,
94  void *keep,
95  size_t size);
96 
97 #endif