Skip to content

String.to_atom/1 would not exhaust potentially the atom table? #25

@kpanic

Description

@kpanic

@gamache hi! First of all, thanks for the library. Maybe I am mistaken, however since we are:

https://github.com/appcues/exconstructor/blob/master/lib/exconstructor.ex#L158-L159 from a newly generated string from Macro.underscore/1 and Macro.camelize/1, wouldn't that be new strings associated with newly created atoms?

For example:

iex(141)> Regex.named_captures(~r/index_table:atom_tab\n*\n.*\n.*\nentries:(?<atoms>.*)/m, :erlang.system_info(:info))
%{"atoms" => " 20963"}
iex(142)> camelized = Macro.camelize("helloworld2")                                                                   
"Helloworld2"
iex(143)> Regex.named_captures(~r/index_table:atom_tab\n*\n.*\n.*\nentries:(?<atoms>.*)/m, :erlang.system_info(:info))
%{"atoms" => " 20963"}
iex(144)> String.to_atom(camelized)                                                                                   
:Helloworld2
iex(145)> Regex.named_captures(~r/index_table:atom_tab\n*\n.*\n.*\nentries:(?<atoms>.*)/m, :erlang.system_info(:info))
%{"atoms" => " 20964"}
iex(146)> 

I already checked issue #5 -- however I might have missed something?
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions