1 -module(beam_stats_ets_table).
3 -include("include/beam_stats_ets_table.hrl").
18 % integer() is just a workaround, to let us mock ets:tid(), which is
19 % opaque, but represented as an integer, without Dialyzer complaining.
29 WordSize = erlang:system_info(wordsize),
30 NumberOfWords = ets:info(ID, memory),
31 NumberOfBytes = NumberOfWords * WordSize,
34 , name = ets:info(ID, name)
35 , size = ets:info(ID, size)
36 , memory = NumberOfBytes
39 -spec id_to_bin(atom() | ets:tid()) ->
41 id_to_bin(ID) when is_atom(ID) ->
42 atom_to_binary(ID, latin1);
43 id_to_bin(ID) when is_integer(ID) ->
44 integer_to_binary(ID).