memorypool.h

Go to the documentation of this file.
00001 /*
00002      This file is part of libmicrohttpd
00003      (C) 2007, 2009 Daniel Pittman and Christian Grothoff
00004 
00005      This library is free software; you can redistribute it and/or
00006      modify it under the terms of the GNU Lesser General Public
00007      License as published by the Free Software Foundation; either
00008      version 2.1 of the License, or (at your option) any later version.
00009 
00010      This library is distributed in the hope that it will be useful,
00011      but WITHOUT ANY WARRANTY; without even the implied warranty of
00012      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013      Lesser General Public License for more details.
00014 
00015      You should have received a copy of the GNU Lesser General Public
00016      License along with this library; if not, write to the Free Software
00017      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 */
00019 
00028 #ifndef MEMORYPOOL_H
00029 #define MEMORYPOOL_H
00030 
00031 #include "internal.h"
00032 
00038 struct MemoryPool;
00039 
00045 struct MemoryPool *MHD_pool_create (size_t max);
00046 
00050 void MHD_pool_destroy (struct MemoryPool *pool);
00051 
00061 void *MHD_pool_allocate (struct MemoryPool *pool,
00062                          size_t size, int from_end);
00063 
00080 void *MHD_pool_reallocate (struct MemoryPool *pool,
00081                            void *old,
00082                            size_t old_size, 
00083                            size_t new_size);
00084 
00093 void *MHD_pool_reset (struct MemoryPool *pool,
00094                       void *keep, 
00095                       size_t size);
00096 
00097 #endif