commit c9a5719: [Minor] Add another helper for mempool typed allocations
Vsevolod Stakhov
vsevolod at highsecure.ru
Thu May 27 14:07:05 UTC 2021
Author: Vsevolod Stakhov
Date: 2021-05-25 10:42:21 +0100
URL: https://github.com/rspamd/rspamd/commit/c9a5719fb6187b59229465be631972ace9f32896
[Minor] Add another helper for mempool typed allocations
---
src/libutil/mem_pool.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/libutil/mem_pool.h b/src/libutil/mem_pool.h
index eea1c6358..d4488ac55 100644
--- a/src/libutil/mem_pool.h
+++ b/src/libutil/mem_pool.h
@@ -155,6 +155,8 @@ void *rspamd_mempool_alloc_ (rspamd_mempool_t *pool, gsize size, const gchar *lo
rspamd_mempool_alloc_((pool), (size), (G_STRLOC))
#define rspamd_mempool_alloc_type(pool, type) \
(type *)(rspamd_mempool_alloc_((pool), sizeof(type), (G_STRLOC)))
+#define rspamd_mempool_alloc_buffer(pool, buflen) \
+ (char *)(rspamd_mempool_alloc_((pool), sizeof(char) * (buflen), (G_STRLOC)))
/**
* Notify external memory usage for memory pool
* @param pool
More information about the Commits
mailing list