GNU libmicrohttpd 0.9.71
memorypool.h
Go to the documentation of this file.
1/*
2 This file is part of libmicrohttpd
3 Copyright (C) 2007--2019 Daniel Pittman, Christian Grothoff and
4 Karlson2k (Evgeny Grin)
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19*/
20
30#ifndef MEMORYPOOL_H
31#define MEMORYPOOL_H
32
33#include "mhd_options.h"
34#include <stddef.h>
35#ifdef HAVE_STDBOOL_H
36#include <stdbool.h>
37#endif
38
44struct MemoryPool;
45
49void
51
52
59struct MemoryPool *
60MHD_pool_create (size_t max);
61
62
68void
69MHD_pool_destroy (struct MemoryPool *pool);
70
71
83void *
84MHD_pool_allocate (struct MemoryPool *pool,
85 size_t size,
86 bool from_end);
87
88
106void *
107MHD_pool_reallocate (struct MemoryPool *pool,
108 void *old,
109 size_t old_size,
110 size_t new_size);
111
112
119size_t
120MHD_pool_get_free (struct MemoryPool *pool);
121
122
136void *
137MHD_pool_reset (struct MemoryPool *pool,
138 void *keep,
139 size_t copy_bytes,
140 size_t new_size);
141
142#endif
void * MHD_pool_reallocate(struct MemoryPool *pool, void *old, size_t old_size, size_t new_size)
Definition: memorypool.c:248
void MHD_pool_destroy(struct MemoryPool *pool)
Definition: memorypool.c:157
size_t MHD_pool_get_free(struct MemoryPool *pool)
Definition: memorypool.c:185
void * MHD_pool_reset(struct MemoryPool *pool, void *keep, size_t copy_bytes, size_t new_size)
Definition: memorypool.c:314
struct MemoryPool * MHD_pool_create(size_t max)
Definition: memorypool.c:102
void * MHD_pool_allocate(struct MemoryPool *pool, size_t size, int from_end)
Definition: memorypool.c:203
additional automatic macros for MHD_config.h
void MHD_init_mem_pools_(void)
Definition: memorypool.c:85