---
name: "mempool_create"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/mempool_create"
---

# mempool\_create(9)

create a memory pool

## NAME

mempool\_create - create a memory pool

## SYNOPSIS

**mempool\_t \* mempool\_create(int** *min\_nr***, mempool\_alloc\_t \*** *alloc\_fn***, mempool\_free\_t \*** *free\_fn***, void \*** *pool\_data***);**

## ARGUMENTS

*min\_nr*

the minimum number of elements guaranteed to be allocated for this pool.

*alloc\_fn*

user-defined element-allocation function.

*free\_fn*

user-defined element-freeing function.

*pool\_data*

optional private data available to the user-defined functions.

## DESCRIPTION

this function creates and allocates a guaranteed size, preallocated memory pool. The pool can be used from the **mempool\_alloc** and **mempool\_free** functions. This function might sleep. Both the **alloc\_fn** and the **free\_fn** functions might sleep - as long as the **mempool\_alloc** function is not called from IRQ contexts.

## COPYRIGHT
