backend/mmapcache.c File Reference


Detailed Description

Definition in file mmapcache.c.

#include "include/logging.h"
#include "lib/safeclib.h"
#include "backend/mmapcache.h"

Include dependency graph for mmapcache.c:

Go to the source code of this file.

Functions

void lumiera_mmapcache_announce (LumieraMMap map)
 Announce a new mmap object to the cache quotas.
void lumiera_mmapcache_checkin (LumieraMMap handle)
 Put a mmap into the cache Mmaps which are checked in are subject of cache aging and might get destroyed and reused.
LumieraMMap lumiera_mmapcache_checkout (LumieraMMap handle)
 Remove a mmap from cache aging Mmaps which are subject of cache aging must be checked out before they can be used.
void lumiera_mmapcache_delete (void)
 Delete the mmap cache.
void lumiera_mmapcache_forget (LumieraMMap map)
 Remove a mmap object from the cache quotas.
void * lumiera_mmapcache_mmap_acquire (void)
 Get a fresh mmap object.
void lumiera_mmapcache_new (size_t limit)
 Initializes the mmapcache.

Variables

LumieraMMapcache lumiera_mcache = NULL


Function Documentation

void lumiera_mmapcache_new ( size_t  limit  ) 

Initializes the mmapcache.

Parameters:
limit the mmapcache will drop elements when the sum of all mmapings gives over limit

Definition at line 38 of file mmapcache.c.

References lumiera_mutex_init().

Here is the call graph for this function:

void lumiera_mmapcache_delete ( void   ) 

Delete the mmap cache.

No mmaps in the cache must be locked, this would be a fatal error. The handles are closed automatically.

Definition at line 54 of file mmapcache.c.

References lumiera_mutex_destroy().

Here is the call graph for this function:

void* lumiera_mmapcache_mmap_acquire ( void   ) 

Get a fresh mmap object.

when mmaped_limit is reached, the oldest mmap object gets dropped else a new allocated object is returned

Returns:
the new uninitialized mmap (void* because this is uninitialized)

Definition at line 69 of file mmapcache.c.

References lumiera_mrucache_pop(), and LUMIERA_MUTEX_SECTION.

Here is the call graph for this function:

void lumiera_mmapcache_announce ( LumieraMMap  map  ) 

Announce a new mmap object to the cache quotas.

Update the statistics kept in the cache, the map object is still considered to be checked out

Parameters:
map object to be announced

Definition at line 94 of file mmapcache.c.

References LUMIERA_MUTEX_SECTION, and lumiera_mmap_struct::size.

Referenced by lumiera_mmap_init(), and lumiera_mmap_init_exact().

Here is the caller graph for this function:

void lumiera_mmapcache_forget ( LumieraMMap  map  ) 

Remove a mmap object from the cache quotas.

Update the statistics kept in the cache, remove it from the cache.

Parameters:
map object to be removed

Definition at line 105 of file mmapcache.c.

References lumiera_mmap_struct::cachenode, LUMIERA_MUTEX_SECTION, and lumiera_mmap_struct::size.

LumieraMMap lumiera_mmapcache_checkout ( LumieraMMap  handle  ) 

Remove a mmap from cache aging Mmaps which are subject of cache aging must be checked out before they can be used.

Parameters:
handle the mmap to be checked out

Definition at line 137 of file mmapcache.c.

References lumiera_mmap_struct::cachenode, lumiera_mrucache_checkout(), LUMIERA_MUTEX_SECTION, and lumiera_mmap_struct::refcnt.

Referenced by lumiera_mmapings_mmap_acquire().

Here is the call graph for this function:

Here is the caller graph for this function:

void lumiera_mmapcache_checkin ( LumieraMMap  handle  ) 

Put a mmap into the cache Mmaps which are checked in are subject of cache aging and might get destroyed and reused.

Parameters:
handle the mmap to be checked in

Definition at line 153 of file mmapcache.c.

References lumiera_mmap_struct::cachenode, lumiera_mrucache_checkin(), LUMIERA_MUTEX_SECTION, and lumiera_mmap_struct::refcnt.

Referenced by lumiera_mmapings_release_mmap().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Thu Jul 22 00:05:28 2010 for Lumiera by  doxygen 1.5.6