diff options
Diffstat (limited to 'src/ts.erl')
-rw-r--r-- | src/ts.erl | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2,7 +2,7 @@ -module(ts). -include_lib("eunit/include/eunit.hrl"). -export_type([tree_store/0]). --export([new/0, delete/1, store/3, retrieve/2, retrieve_hash/2]). +-export([new/0, delete/1, size/1, store/3, retrieve/2, retrieve_hash/2]). %% -record(tree_store, {warm :: ets:tid(), %% frozen :: list()}). % [ets:tid()] @@ -15,7 +15,10 @@ new() -> #tree_store{table = ets:new(nil, [{read_concurrency, true}])}. delete(Store) -> - ets:delete(Store#tree_store.table). + ets:delete(Store#tree_store.table). + +size(Store) -> + ets:info(Store#tree_store.table, size). -spec store(tree_store(), tuple(), binary()) -> tree_store(). store(Store, IR, Hash) -> |