Update comment.
This commit is contained in:
1 parent
39e8c9e678
commit
6d6150e189
1 file changed
+14
-2
+14
-2
@@ -29,11 +29,19 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "m-core.h"
|
#include "m-core.h"
|
||||||
|
|
||||||
|
/* Fast Fixed Size thread unsafe allocator.
|
||||||
|
USAGE:
|
||||||
|
MEMPOOL_DEF(uint, unsigned int)
|
||||||
|
...
|
||||||
|
memppol_uint_t m;
|
||||||
|
mempool_uint_init(m);
|
||||||
|
// alloc with mempool_uint_alloc(m);
|
||||||
|
// free with mempool_uin_free(m, ptr);
|
||||||
|
mempool_uint_clear(m); // Give back memory to system
|
||||||
|
*/
|
||||||
// NOTE: Can not use m-list since it may be expanded from LIST_DEF
|
// NOTE: Can not use m-list since it may be expanded from LIST_DEF
|
||||||
// FIXME: Shall this use standard memory function (malloc) or M_MEMORY_ALLOC?
|
// FIXME: Shall this use standard memory function (malloc) or M_MEMORY_ALLOC?
|
||||||
|
|
||||||
#define MEMPOOLI_MAX_PER_SEGMENT(type) M_MAX(16*1024 / sizeof (type), 256U)
|
|
||||||
|
|
||||||
#define MEMPOOL_DEF(name, type) \
|
#define MEMPOOL_DEF(name, type) \
|
||||||
\
|
\
|
||||||
typedef union M_C3(mempool_,name,_union_s) { \
|
typedef union M_C3(mempool_,name,_union_s) { \
|
||||||
@@ -125,4 +133,8 @@
|
|||||||
mem->count--; \
|
mem->count--; \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
|
/********************************** INTERNAL ************************************/
|
||||||
|
|
||||||
|
#define MEMPOOLI_MAX_PER_SEGMENT(type) M_MAX(16*1024 / sizeof (type), 256U)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user