Skip to content

Instantly share code, notes, and snippets.

@robertoaloi
Last active Jul 16, 2019
Embed
What would you like to do?
-module(atom_table).
-export([count/0]).
count() ->
Info = erlang:system_info(info),
Chunks = binary:split(Info, <<"=">>, [global]),
[TabInfo] = [X || <<"index_table:atom_tab", X/binary>> <- Chunks],
Lines = binary:split(TabInfo, <<"\n">>, [global]),
Chunks2 = [binary:split(L, <<": ">>) || L <- Lines, L =/= <<>>],
binary_to_integer(proplists:get_value(<<"entries">>, Chunks2)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment