summaryrefslogtreecommitdiff
path: root/tools/testing/radix-tree/linux/mempool.h
blob: 6a2dc55b41d636ca08aacdf9546fe9e757dd787b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

#include <linux/slab.h>

typedef void *(mempool_alloc_t)(int gfp_mask, void *pool_data);
typedef void (mempool_free_t)(void *element, void *pool_data);

typedef struct {
	mempool_alloc_t *alloc;
	mempool_free_t *free;
	void *data;
} mempool_t;

void *mempool_alloc(mempool_t *pool, int gfp_mask);
void mempool_free(void *element, mempool_t *pool);
mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
			mempool_free_t *free_fn, void *pool_data);