diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-04-05 16:48:35 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-04-05 19:44:49 +0300 |
commit | edf692a61627394c26132e203857afc5237495c3 (patch) | |
tree | 0d06ed9cad5859d2051553da6f492a8e15fc50f9 /src/microhttpd/memorypool.h | |
parent | 95ad2a9a480435e86dfa1bbd7a6798150320d3bd (diff) | |
download | libmicrohttpd-edf692a61627394c26132e203857afc5237495c3.tar.gz libmicrohttpd-edf692a61627394c26132e203857afc5237495c3.zip |
Implemented and used new function MHD_pool_deallocate()
The new function has special handling for user-poison mode.
Diffstat (limited to 'src/microhttpd/memorypool.h')
-rw-r--r-- | src/microhttpd/memorypool.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/microhttpd/memorypool.h b/src/microhttpd/memorypool.h index 98f96bda..49bbcbe1 100644 --- a/src/microhttpd/memorypool.h +++ b/src/microhttpd/memorypool.h | |||
@@ -148,6 +148,24 @@ MHD_pool_get_free (struct MemoryPool *pool); | |||
148 | 148 | ||
149 | 149 | ||
150 | /** | 150 | /** |
151 | * Deallocate a block of memory obtained from the pool. | ||
152 | * | ||
153 | * If the given block is not the most recently | ||
154 | * (re)allocated block, the memory of the this block | ||
155 | * allocation may be not released until the pool is | ||
156 | * destroyed or reset. | ||
157 | * | ||
158 | * @param pool memory pool to use for the operation | ||
159 | * @param block the allocated block, the NULL is tolerated | ||
160 | * @param block_size the size of the allocated block | ||
161 | */ | ||
162 | void | ||
163 | MHD_pool_deallocate (struct MemoryPool *pool, | ||
164 | void *block, | ||
165 | size_t block_size); | ||
166 | |||
167 | |||
168 | /** | ||
151 | * Clear all entries from the memory pool except | 169 | * Clear all entries from the memory pool except |
152 | * for @a keep of the given @a copy_bytes. The pointer | 170 | * for @a keep of the given @a copy_bytes. The pointer |
153 | * returned should be a buffer of @a new_size where | 171 | * returned should be a buffer of @a new_size where |