#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... | |
Enumerations | |
| enum | aging_magic { AGING_MAGIC = 0xb8e2fac3U } |
| The hash table is the central piece, but we also have a `value freeing' callback, since the values can expire automatically. More... | |
Functions | |
| aging * | aging_make (gint delay, GHashFunc hash, GEqualFunc eq, aging_free_t kfree) |
| 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 (struct aging *ag) |
| Destroy container, freeing all keys and values. | |
| void | aging_expire (cqueue_t *unused_cq, gpointer obj) |
| Expire value entry. | |
| gpointer | aging_lookup (struct aging *ag, gpointer key) |
| Lookup value in table. | |
| void | aging_remove (struct aging *ag, 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 (struct aging *ag, 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.
|
1.3.9.1