mojave man page for libcache

Query: libcache

OS: mojave

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

libcache(3)						   BSD Library Functions Manual 					       libcache(3)

NAME
libcache -- the caching framework
SYNOPSIS
#include <cache.h>
DESCRIPTION
The libcache framework provides a facility for creating in memory data caches. Each cache is a mutable dictionary that associates values with their keys. A cache limits the number of values it keeps according to available system memory and selects values to evict when the limit is exceeded. Recently and frequently used values are less likely to be selected for eviction. Cache keys and values should be cast as pointers. The framework provides a callback interface for supporting arbitrary types of keys and values and implements callback functions for common types. See cache_callbacks(3) for more information. Clients retrieve a value previously added to a cache using the value's key. When the client gets a value, the cache increments a reference count on the value. When the client finishes with a value retrieved from a cache they must release the value back to the cache. Referenced values are considered in use and will not be evicted. The cache may evict unreferenced values (e.g. to make room for other values or reduce its size). The number of values allowed in a cache at one time is managed by the cache framework. Cache size will grow when the system has available memory and shrink under memory pressure. Libcache is thread-safe. It is not safe to call back into the cache API from cache callback functions.
SEE ALSO
cache_create(3), cache_set_and_retain(3) Darwin May 7, 2009 Darwin
Related Man Pages
cache_destroy(3) - mojave
cache_remove(3) - mojave
libcache(3) - mojave
cache_callbacks(3) - osx
cache_get_and_retain(3) - osx
Similar Topics in the Unix Linux Community
reduce buffer cache allocation?
values
Need to release Cache memory
shell script
Clearing memory cache on Linux server