#include "common.h"
#include "aging.h"
#include "cq.h"
#include "misc.h"
#include "tm.h"
#include "walloc.h"
#include "override.h"
Data Structures | |
struct | aging |
struct | aging_value |
We wrap the values we insert in the table, since each value must keep track of its insertion time, and cleanup event. More... | |
Defines | |
#define | AGING_MAGIC 0xa9179 |
The hash table is the central piece, but we also have a `value freeing' callback, since the values can expire automatically. | |
Functions | |
RCSID ("$Id:aging.c, v 1.9 2005/08/31 21:37:32 rmanfredi Exp $") | |
gpointer | aging_make (gint delay, GHashFunc hash, GEqualFunc eq, aging_free_t kfree, gpointer kdata, aging_free_t vfree, gpointer vdata) |
Create new aging container. | |
void | aging_free_kv (gpointer key, gpointer value, gpointer udata) |
Free keys and values from the aging table. | |
void | aging_destroy (gpointer obj) |
Destroy container, freeing all keys and values. | |
void | aging_expire (cqueue_t *unused_cq, gpointer obj) |
Expire value entry. | |
gpointer | aging_lookup (gpointer obj, gpointer key) |
Lookup value in table. | |
void | aging_remove (gpointer obj, gpointer key) |
Remove value associated with key, dispose of items (key and value) stored in the hash table, but leave the function parameter alone. | |
void | aging_insert (gpointer obj, gpointer key, gpointer value) |
Add value to the table. |
|
The hash table is the central piece, but we also have a `value freeing' callback, since the values can expire automatically.
|
|
Destroy container, freeing all keys and values.
|
|
Expire value entry.
|
|
Free keys and values from the aging table.
|
|
Add value to the table. If it was already present, its lifetime is augmented by the aging delay. The key argument is freed immediately if there is a free routine for keys and the key was present in the table. The previous value is freed and replaced by the new one if there is an insertion conflict and the value pointers are different. |
|
Lookup value in table.
|
|
Create new aging container.
|
|
Remove value associated with key, dispose of items (key and value) stored in the hash table, but leave the function parameter alone.
|
|
|