ChibiOS 21.11.4
chobjcaches.h File Reference

Objects Caches macros and structures. More...

Go to the source code of this file.

Data Structures

struct  ch_oc_hash_header
 Structure representing an hash table element. More...
struct  ch_oc_lru_header
 Structure representing an hash table element. More...
struct  ch_oc_object
 Structure representing a cached object. More...
struct  ch_objects_cache
 Structure representing a cache object. More...

Macros

Cached objects flags
#define OC_FLAG_INLRU   0x00000001U
#define OC_FLAG_INHASH   0x00000002U
#define OC_FLAG_SHARED   0x00000004U
#define OC_FLAG_NOTSYNC   0x00000008U
#define OC_FLAG_LAZYWRITE   0x00000010U
#define OC_FLAG_FORGET   0x00000020U

Typedefs

typedef uint32_t oc_flags_t
 Flags of cached objects.
typedef struct ch_oc_hash_header oc_hash_header_t
 Type of an hash element header.
typedef struct ch_oc_lru_header oc_lru_header_t
 Type of an LRU element header.
typedef struct ch_oc_object oc_object_t
 Type of a cached object.
typedef struct ch_objects_cache objects_cache_t
 Type of a cache object.
typedef bool(* oc_readf_t) (objects_cache_t *ocp, oc_object_t *objp, bool async)
 Object read function.
typedef bool(* oc_writef_t) (objects_cache_t *ocp, oc_object_t *objp, bool async)
 Object write function.

Functions

void chCacheObjectInit (objects_cache_t *ocp, ucnt_t hashn, oc_hash_header_t *hashp, ucnt_t objn, size_t objsz, void *objvp, oc_readf_t readf, oc_writef_t writef)
 Initializes a objects_cache_t object.
oc_object_tchCacheGetObject (objects_cache_t *ocp, uint32_t group, uint32_t key)
 Retrieves an object from the cache.
void chCacheReleaseObjectI (objects_cache_t *ocp, oc_object_t *objp)
 Releases an object into the cache.
bool chCacheReadObject (objects_cache_t *ocp, oc_object_t *objp, bool async)
 Reads object data from the storage.
bool chCacheWriteObject (objects_cache_t *ocp, oc_object_t *objp, bool async)
 Writes the object data back to storage.
static void chCacheReleaseObject (objects_cache_t *ocp, oc_object_t *objp)
 Releases an object into the cache.

Detailed Description

Objects Caches macros and structures.

Definition in file chobjcaches.h.