ec_cache_delref

March 26, 2020 Contributors

Name

ec_cache_delref — Delete a reference from a cached item determined by elt in a cache

Synopsis

#include "ec_cache.h"

| void **ec_cache_delref** ( | cache, |   |
|   | elt); |   |

ec_cache_t * <var class="pdparam">cache</var>;
ec_cache_elt * <var class="pdparam">elt</var>;

Description

Decrement a reference from a cached item determined by elt in a cache. If the refcount falls to zero, then the function registered in the call to ec_cache_create2 will be invoked. The following typedef applies to this data type: typedef void (*ec_cache_elt_dtor_func)(void *value);

After calling ec_cache_delref the element and its contents must not be touched, as they may have been freed.

Parameters

cache

The address of the cache. The following typedef applies to the ec_cache_t data type:

typedef struct ec_cache_head ec_cache_t;

elt

The address of the cache entry to delref. See the “ec_cache_elt” structure.

Return Values

This function returns void.

Threading

It is legal to call this function in any thread.

See Also

ec_cache_create, ec_cache_create2, ec_cache_destroy, ec_cache_find, ec_cache_insert, ec_cache_purge, “ec_cache_head”, and “ec_cache_elt”.