GNU libmicrohttpd 0.9.77
Loading...
Searching...
No Matches
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#ifdef HAVE_STDDEF_H
35#include <stddef.h>
36#endif /* HAVE_STDDEF_H */
37#ifdef HAVE_STDBOOL_H
38#include <stdbool.h>
39#endif
40
46struct MemoryPool;
47
51void
53
54
61struct MemoryPool *
62MHD_pool_create (size_t max);
63
64
70void
71MHD_pool_destroy (struct MemoryPool *pool);
72
73
85void *
86MHD_pool_allocate (struct MemoryPool *pool,
87 size_t size,
88 bool from_end);
89
90
110void *
111MHD_pool_try_alloc (struct MemoryPool *pool,
112 size_t size,
113 size_t *required_bytes);
114
115
133void *
134MHD_pool_reallocate (struct MemoryPool *pool,
135 void *old,
136 size_t old_size,
137 size_t new_size);
138
139
146size_t
147MHD_pool_get_free (struct MemoryPool *pool);
148
149
163void *
164MHD_pool_reset (struct MemoryPool *pool,
165 void *keep,
166 size_t copy_bytes,
167 size_t new_size);
168
169#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:136
void * MHD_pool_try_alloc(struct MemoryPool *pool, size_t size, size_t *required_bytes)
Definition memorypool.c:373