JULEA
Data Structures | Typedefs | Functions
Cache

Data Structures

struct  JCache
 

Typedefs

typedef struct JCache JCache
 

Functions

JCachej_cache_new (guint64 size)
 
void j_cache_free (JCache *cache)
 
gpointer j_cache_get (JCache *cache, guint64 length)
 
void j_cache_release (JCache *cache, gpointer data)
 

Detailed Description

Typedef Documentation

◆ JCache

typedef struct JCache JCache

Function Documentation

◆ j_cache_free()

void j_cache_free ( JCache cache)

Frees the memory allocated for the cache.

JCache* cache;
...
j_cache_free(cache);
Definition: jcache.c:43
Parameters
cacheA cache.

◆ j_cache_get()

gpointer j_cache_get ( JCache cache,
guint64  length 
)

Gets a new segment from the cache.

JCache* cache;
...
j_cache_get(cache, 1024);
Parameters
cacheA cache.
lengthA length.
Returns
A pointer to a segment of the cache, NULL if not enough space is available.

◆ j_cache_new()

JCache * j_cache_new ( guint64  size)

Creates a new cache.

JCache* cache;
cache = j_cache_new(1024);
JCache * j_cache_new(guint64 size)
Definition: jcache.c:57
Parameters
sizeA size.
Returns
A new cache. Should be freed with j_cache_free().

◆ j_cache_release()

void j_cache_release ( JCache cache,
gpointer  data 
)

Frees cache memory

JCache* cache;
cache = j_cache_new(1024);
Parameters
cacheA cache.
dataA pointer to cached data.