Files | |
| file | tcache.c |
| file | tcache.h |
Data Structures | |
| struct | PINT_tcache |
| Describes a tcache instance. More... | |
| struct | PINT_tcache_entry |
| Describes a single entry in the tcache. More... | |
Enumerations | |
| enum | PINT_tcache_replace_algorithms { LEAST_RECENTLY_USED = 1 } |
| enum | PINT_tcache_options { TCACHE_TIMEOUT_MSECS = 1, TCACHE_NUM_ENTRIES = 2, TCACHE_HARD_LIMIT = 3, TCACHE_SOFT_LIMIT = 4, TCACHE_ENABLE = 5, TCACHE_RECLAIM_PERCENTAGE = 6, TCACHE_REPLACE_ALGORITHM = 7, TCACHE_ENABLE_EXPIRATION = 8 } |
Functions | |
| PINT_tcache * | PINT_tcache_initialize (int(*compare_key_entry)(void *key, struct qhash_head *link), int(*hash_key)(void *key, int table_size), int(*free_payload)(void *payload), int table_size) |
| void | PINT_tcache_finalize (struct PINT_tcache *tcache) |
| int | PINT_tcache_get_info (struct PINT_tcache *tcache, enum PINT_tcache_options option, unsigned int *arg) |
| int | PINT_tcache_set_info (struct PINT_tcache *tcache, enum PINT_tcache_options option, unsigned int arg) |
| int | PINT_tcache_insert_entry (struct PINT_tcache *tcache, void *key, void *payload, int *purged) |
| int | PINT_tcache_lookup (struct PINT_tcache *tcache, void *key, struct PINT_tcache_entry **entry, int *status) |
| int | PINT_tcache_reclaim (struct PINT_tcache *tcache, int *reclaimed) |
| int | PINT_tcache_delete (struct PINT_tcache *tcache, struct PINT_tcache_entry *entry) |
| int | PINT_tcache_refresh_entry (struct PINT_tcache *tcache, struct PINT_tcache_entry *entry) |
A timeout is associated with each entry to dictate when it will expire. Specific caches such as the attribute or name cache may be built on top of this one.
Notes:
|
|
|
enumeration for algorithms to use to determine how to search the tcache to find an entry to be replaced.
|
|
||||||||||||
|
Removes and destroys specified tcache entry. The payload_free() function will be used to destroy payload data.
|
|
|
Finalizes and destroys a tcache instance, frees all payloads.
|
Here is the call graph for this function:

|
||||||||||||||||
|
Retrieves parameters from a tcache instance.
|
|
||||||||||||||||||||
|
Initializes a tcache instance.
|
|
||||||||||||||||||||
|
Adds an entry to the tcache. Caller must not retain a pointer to the payload; it could be destroyed at any time.
|
Here is the call graph for this function:

|
||||||||||||||||||||
|
Looks up an entry. Subsequent tcache function calls may destroy the entry and payload. Therefore the caller should copy the payload data if it intends to use it after another tcache function call.
|
Here is the call graph for this function:

|
||||||||||||
|
Tries to purge and destroy expired entries, up to TCACHE_RECLAIM_PERCENTAGE of the current soft limit value. The payload_free() function is used to destroy the payload associated with reclaimed entries.
|
Here is the call graph for this function:

|
||||||||||||
|
Updates the timestamp on the specified entry to TCACHE_TIMEOUT milliseconds in the future.
|
|
||||||||||||||||
|
Sets optional parameters on a tcache instance.
|
1.3.5