Ejemplo n.º 1
0
/**
 * _cairo_cache_remove_random:
 * @cache: a cache
 *
 * Remove a random entry from the cache.
 *
 * Return value: %TRUE if an entry was successfully removed.
 * %FALSE if there are no entries that can be removed.
 **/
static cairo_bool_t
_cairo_cache_remove_random (cairo_cache_t *cache)
{
    cairo_cache_entry_t *entry;

    entry = _cairo_hash_table_random_entry (cache->hash_table, NULL);
    if (unlikely (entry == NULL))
        return FALSE;

    _cairo_cache_remove (cache, entry);

    return TRUE;
}
Ejemplo n.º 2
0
static void
_cairo_cache_pluck (void *entry, void *closure)
{
    _cairo_cache_remove ((cairo_cache_t *)closure, (cairo_cache_entry_t *)entry);
}
Ejemplo n.º 3
0
static void
_cairo_cache_pluck (void *entry, void *closure)
{
    _cairo_cache_remove (closure, entry);
}