src/server/ucx/mempool.h

changeset 36
450d2d5f4735
parent 15
cff9c4101dd7
child 71
069c152f6272
--- a/src/server/ucx/mempool.h	Sat Aug 18 11:39:34 2012 +0200
+++ b/src/server/ucx/mempool.h	Sat Oct 06 13:00:07 2012 +0200
@@ -5,6 +5,9 @@
 #ifndef MPOOL_H
 #define	MPOOL_H
 
+#include <stddef.h>
+#include "allocator.h"
+
 #ifdef	__cplusplus
 extern "C" {
 #endif
@@ -17,6 +20,11 @@
     size_t size;
 } UcxMempool;
 
+#define UCX_ALLOCATOR_MEMPOOL(pool) {pool, \
+    (ucx_allocator_malloc) ucx_mempool_malloc, \
+    (ucx_allocator_calloc) ucx_mempool_calloc, \
+    (ucx_allocator_realloc) ucx_mempool_realloc}
+
 #define ucx_mempool_new_default() ucx_mempool_new(16)
 UcxMempool *ucx_mempool_new(size_t n);
 int ucx_mempool_chcap(UcxMempool *pool, size_t newcap);

mercurial