libdatatypes 0.3.2
Abstract datatypes for C.
Loading...
Searching...
No Matches
pool.c File Reference

Allocate memory blocks of same sizes. More...

#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "pool.h"

Go to the source code of this file.

Functions

MemoryPoolmemory_pool_new (size_t item_size, size_t block_size)
 
void memory_pool_destroy (MemoryPool *pool)
 

Detailed Description

Allocate memory blocks of same sizes.

Author
Sebastian Fedrau sebas.nosp@m.tian.nosp@m..fedr.nosp@m.au@g.nosp@m.mail..nosp@m.com

Definition in file pool.c.

Function Documentation

◆ memory_pool_destroy()

void memory_pool_destroy ( MemoryPool pool)
Parameters
poolMemoryPool to destroy

Destroys the given MemoryPool.

Definition at line 202 of file pool.c.

◆ memory_pool_new()

MemoryPool * memory_pool_new ( size_t  item_size,
size_t  block_size 
)
Parameters
item_sizesize of allocated items
block_sizenumber of elements a memory can hold
Returns
a new pool

Creates a new MemoryPool.

Definition at line 175 of file pool.c.