erllama_cache_ram (erllama v0.1.0)
View SourceRAM tier slab store.
Owns the erllama_cache_ram_slabs ETS table. Reads and deletes
are direct ETS operations from any process; puts go through this
module's put/3 because they need to atomically (a) insert the
slab and (b) register the meta row via the meta server.
Slab binaries above 64 bytes live off-heap as refcounted ProcBins
so ets:lookup returns a binary reference, not a copy. There is
no slab fragmentation to worry about; eviction frees the slab
binary by deleting its row.
Summary
Functions
-spec delete(erllama_cache:cache_key()) -> ok.
-spec init([]) -> {ok, []}.
-spec load(erllama_cache:cache_key()) -> {ok, binary()} | miss.
-spec put(erllama_cache:cache_key(), binary(), binary()) -> ok.
-spec size_bytes() -> non_neg_integer().