GNU libmicrohttpd 1.0.2
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--2024 Daniel Pittman and Christian Grothoff
4 Copyright (C) 2016--2024 Evgeny Grin (Karlson2k)
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
100bool
101MHD_pool_is_resizable_inplace (struct MemoryPool *pool,
102 void *block,
103 size_t block_size);
104
124void *
125MHD_pool_try_alloc (struct MemoryPool *pool,
126 size_t size,
127 size_t *required_bytes);
128
129
147void *
148MHD_pool_reallocate (struct MemoryPool *pool,
149 void *old,
150 size_t old_size,
151 size_t new_size);
152
153
160size_t
161MHD_pool_get_free (struct MemoryPool *pool);
162
163
176void
177MHD_pool_deallocate (struct MemoryPool *pool,
178 void *block,
179 size_t block_size);
180
181
195void *
196MHD_pool_reset (struct MemoryPool *pool,
197 void *keep,
198 size_t copy_bytes,
199 size_t new_size);
200
201#endif
void MHD_init_mem_pools_(void)
Definition memorypool.c:209
void * MHD_pool_reallocate(struct MemoryPool *pool, void *old, size_t old_size, size_t new_size)
Definition memorypool.c:533
void MHD_pool_destroy(struct MemoryPool *pool)
Definition memorypool.c:341
bool MHD_pool_is_resizable_inplace(struct MemoryPool *pool, void *block, size_t block_size)
Definition memorypool.c:440
void MHD_pool_deallocate(struct MemoryPool *pool, void *block, size_t block_size)
Definition memorypool.c:625
void * MHD_pool_try_alloc(struct MemoryPool *pool, size_t size, size_t *required_bytes)
Definition memorypool.c:481
size_t MHD_pool_get_free(struct MemoryPool *pool)
Definition memorypool.c:374
void * MHD_pool_reset(struct MemoryPool *pool, void *keep, size_t copy_bytes, size_t new_size)
Definition memorypool.c:729
struct MemoryPool * MHD_pool_create(size_t max)
Definition memorypool.c:270
void * MHD_pool_allocate(struct MemoryPool *pool, size_t size, bool from_end)
Definition memorypool.c:399
additional automatic macros for MHD_config.h