mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 21:48:55 +00:00
a967370df5
Original commit message from CVS: gst-indent run on core
40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
#include <glib.h>
|
|
|
|
typedef struct _GstMemPool GstMemPool;
|
|
typedef struct _GstMemPoolElement GstMemPoolElement;
|
|
|
|
typedef void (*GstMemPoolAllocFunc) (GstMemPool * pool, gpointer data);
|
|
typedef void (*GstMemPoolFreeFunc) (GstMemPool * pool, gpointer data);
|
|
|
|
struct _GstMemPoolElement
|
|
{
|
|
GstMemPoolElement *link; /* next cell in the lifo */
|
|
GstMemPoolElement *area;
|
|
};
|
|
|
|
struct _GstMemPool
|
|
{
|
|
volatile GstMemPoolElement *free; /* the first free element */
|
|
volatile gulong cnt; /* used to avoid ABA problem */
|
|
|
|
gchar *name;
|
|
gulong area_size;
|
|
gulong pool_size;
|
|
gulong atom_size;
|
|
gboolean cleanup;
|
|
GstMemPoolAllocFunc alloc_func;
|
|
GstMemPoolFreeFunc free_func;
|
|
GMutex *chunk_lock;
|
|
};
|
|
|
|
|
|
GstMemPool *gst_mem_pool_new (gchar * name,
|
|
gint atom_size,
|
|
gulong area_size,
|
|
gint type, GstMemPoolAllocFunc alloc_func, GstMemPoolFreeFunc free_func);
|
|
|
|
void gst_mem_pool_destroy (GstMemPool * mem_pool);
|
|
|
|
gpointer gst_mem_pool_alloc (GstMemPool * mem_pool);
|
|
gpointer gst_mem_pool_alloc0 (GstMemPool * mem_pool);
|
|
void gst_mem_pool_free (GstMemPool * mem_pool, gpointer mem);
|