Last active
July 16, 2019 13:44
-
-
Save robertoaloi/5576f79f0378c9f504b99a1731d918b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-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