xine-lib: xine-lib-1.2.13/src/xine-utils/pool.c File Reference

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Typedefs | Functions
pool.c File Reference
`#include <xine/attributes.h>`
`#include <xine/pool.h>`
`#include <xine/xineutils.h>`
`#include <xine/array.h>`

## Data Structures
struct | xine_pool_chunk_s
struct | xine_pool_s

## Macros
#define | MIN_CHUNK_SIZE 32
#define | MAX_CHUNK_SIZE 65536

## Typedefs
typedef struct xine_pool_chunk_s | xine_pool_chunk_t

## Functions
static xine_pool_chunk_t * | xine_pool_alloc_chunk (size_t object_size, size_t object_count)
static void | xine_pool_delete_chunk (xine_pool_chunk_t *chunk)
xine_pool_t * | xine_pool_new (size_t object_size, void(*create_object)(void *object), void(*prepare_object)(void *object), void(*return_object)(void *object), void(*delete_object)(void *object))
void | xine_pool_delete (xine_pool_t *pool)
void * | xine_pool_get (xine_pool_t *pool)
void | xine_pool_put (xine_pool_t *pool, void *object)

## Macro Definition Documentation

## ◆ MAX_CHUNK_SIZE

#define MAX_CHUNK_SIZE 65536

Referenced by xine_pool_get().

## ◆ MIN_CHUNK_SIZE

#define MIN_CHUNK_SIZE 32

Referenced by xine_pool_new().

## Typedef Documentation

## ◆ xine_pool_chunk_t

typedef struct xine_pool_chunk_s xine_pool_chunk_t

## Function Documentation

## ◆ xine_pool_alloc_chunk()

static xine_pool_chunk_t * xine_pool_alloc_chunk | ( | size_t | object_size,
|  | size_t | object_count )
| static

References _x_assert, xine_pool_chunk_s::count, xine_pool_chunk_s::current_id, xine_pool_chunk_s::mem_base, and NULL.

Referenced by xine_pool_get(), and xine_pool_new().

## ◆ xine_pool_delete()

void xine_pool_delete | ( | xine_pool_t * | pool | ) |

References _x_assert, xine_pool_s::chunk_list, xine_pool_chunk_s::current_id, xine_pool_s::delete_object, xine_pool_chunk_s::mem_base, xine_pool_s::object_size, xine_array_get(), xine_array_size(), and xine_pool_delete_chunk().

Referenced by xine_ring_buffer_delete().

## ◆ xine_pool_delete_chunk()

static void xine_pool_delete_chunk | ( | xine_pool_chunk_t * | chunk | ) |
| static

References _x_assert.

Referenced by xine_pool_delete().

## ◆ xine_pool_get()

void * xine_pool_get | ( | xine_pool_t * | pool | ) |

References _x_assert, xine_pool_s::chunk_list, xine_pool_chunk_s::count, xine_pool_s::create_object, xine_pool_chunk_s::current_id, xine_pool_s::free_list, MAX_CHUNK_SIZE, xine_pool_chunk_s::mem_base, NULL, xine_pool_s::object_size, xine_pool_s::prepare_object, xine_array_add(), xine_array_get(), xine_array_remove(), xine_array_size(), and xine_pool_alloc_chunk().

Referenced by xine_ring_buffer_alloc(), and xine_ring_buffer_get().

## ◆ xine_pool_new()

xine_pool_t * xine_pool_new | ( | size_t | object_size,
|  | void(* | create_object )(void *object),
|  | void(* | prepare_object )(void *object),
|  | void(* | return_object )(void *object),
|  | void(* | delete_object )(void *object) )

References _x_assert, xine_pool_s::chunk_list, xine_pool_s::create_object, xine_pool_s::delete_object, xine_pool_s::free_list, MIN_CHUNK_SIZE, NULL, xine_pool_s::object_size, xine_pool_s::prepare_object, xine_pool_s::return_object, xine_array_add(), xine_array_new(), and xine_pool_alloc_chunk().

Referenced by xine_ring_buffer_new().

## ◆ xine_pool_put()

void xine_pool_put | ( | xine_pool_t * | pool,
|  | void * | object )

References _x_assert, xine_pool_s::free_list, xine_pool_s::return_object, and xine_array_add().

Referenced by xine_ring_buffer_put(), and xine_ring_buffer_release().