marshal v0.9.0 Cache

Functions for manipulating and maintaining the marshal decode caches

Summary

Functions

Add an object to the cache

Add a symbol to the cache

Retrieve an object from the cache for a type link

Retrieve a symbol from the cache for a symlink reference

Replace an object stored in the cache. Used for replacing a placeholder with a real value

Replace an symbol stored in the cache. Used for updating a symbol with ivars

Functions

add_to_object_cache(object, arg)

Add an object to the cache.

Examples

iex> Cache.add_to_object_cache(%{1 => 2}, {%{}, %{}})
{%{}, %{0 => %{1 => 2}}}
add_to_symbol_cache(symbol, arg)

Add a symbol to the cache.

Examples

iex> Cache.add_to_symbol_cache(:test, {%{}, %{}})
{%{0 => :test}, %{}}
fetch_object(index, arg)

Retrieve an object from the cache for a type link.

Examples

iex> Cache.fetch_object(1, {%{0 => :apple, 1 => :banana}, %{0 => ["test"], 1 => "test"}})
"test"
fetch_symbol(index, arg)

Retrieve a symbol from the cache for a symlink reference.

Examples

iex> Cache.fetch_symbol(1, {%{0 => :apple, 1 => :banana}, %{0 => ["test"], 1 => "test"}})
:banana
replace_object_cache(old, new, arg)

Replace an object stored in the cache. Used for replacing a placeholder with a real value.

Examples

iex> Cache.replace_object_cache(<<0xFF>>, "test", {%{}, %{0 => <<0>>, 1 => <<0xFF>>}})
{%{}, %{0 => <<0>>, 1 => "test"}}
replace_symbol_cache(old, new, arg)

Replace an symbol stored in the cache. Used for updating a symbol with ivars.

Examples

iex> Cache.replace_symbol_cache(:test, :test_update, {%{0 => :test}, %{}})
{%{0 => :test_update}, %{}}