1MEMPOOL_CREATE(9) Memory Management in Linux MEMPOOL_CREATE(9)
2
3
4
6 mempool_create - create a memory pool
7
9 mempool_t * mempool_create(int min_nr, mempool_alloc_t * alloc_fn,
10 mempool_free_t * free_fn, void * pool_data);
11
13 min_nr
14 the minimum number of elements guaranteed to be allocated for this
15 pool.
16
17 alloc_fn
18 user-defined element-allocation function.
19
20 free_fn
21 user-defined element-freeing function.
22
23 pool_data
24 optional private data available to the user-defined functions.
25
27 this function creates and allocates a guaranteed size, preallocated
28 memory pool. The pool can be used from the mempool_alloc and
29 mempool_free functions. This function might sleep. Both the alloc_fn
30 and the free_fn functions might sleep - as long as the mempool_alloc
31 function is not called from IRQ contexts.
32
34Kernel Hackers Manual 3.10 June 2019 MEMPOOL_CREATE(9)