Skip to content
/ libalru Public

libalru is a library for creating really fast numeric based LRU caches that leverage an optimized CRC-16-CCITT ported over from @mafintosh's array-lru

License

Notifications You must be signed in to change notification settings

jwerle/libalru

Repository files navigation

libalru

Abstract

libalru is a library for creating really fast numeric based LRU caches that leverage an optimized CRC-16-CCITT ported from array-lru. Values are unsigned 64 bit integers that point to a memory address and are associated with an unsigned integer index where index is at most the size of the internal cache.

Installation

With clib do:

$ clib install jwerle/libalru

Or from source do:

$ git clone git@github.com:jwerle/libalru.git
$ cd libalru
$ ./configure
$ make
$ sudo make install

API

typedef struct alru alru_t;

TODO

typedef ALRUvoid (alru_evict_f)(alru_t *, alru_uint64_t, alru_uintptr_t);

TODO

ALRUboolean alru_init(alru_t *alru, alru_uint64_t collisions, alru_uint64_t max);

Initializes an already allocated alru_t * pointer with a max cache size. If an already

ALRUboolean alru_deinit(alru_t *alru);

TODO

ALRUboolean alru_set(alru_t *alru, alru_uint64_t index, alru_uintptr_t value);

TODO

alru_uintptr_t alru_get(alru_t *alru, alru_uint64_t index);

TODO

ALRUboolean alru_clear(alru_t *alru);

TODO

inline ALRU_EXPORT alru_t * alru(alru_uint64_t max);

Allocates and returns a new alru_t * pointer.

Example

TODO

License

MIT

About

libalru is a library for creating really fast numeric based LRU caches that leverage an optimized CRC-16-CCITT ported over from @mafintosh's array-lru

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published