Skip to content

Add erlang:loaded/0 NIF#2211

Merged
bettio merged 1 commit intoatomvm:mainfrom
petermm:erlang-loaded
Mar 18, 2026
Merged

Add erlang:loaded/0 NIF#2211
bettio merged 1 commit intoatomvm:mainfrom
petermm:erlang-loaded

Conversation

@petermm
Copy link
Copy Markdown
Contributor

@petermm petermm commented Mar 17, 2026

A more memory effective way of getting loaded modules (on BEAM - not atomvm), used by Elixir 1.20, in IEX autocomplete.

Add erlang:loaded/0 which returns a list of all currently loaded modules, matching the OTP behavior.

Identical to nif_code_all_loaded, except it only returns modules, and not filepaths (shimmed/stubbed nif_code_all_loaded atomvm)

Changes:
Implement erlang:loaded/0 NIF in nifs.c
Register in nifs.gperf
Add Erlang stub with edoc in estdlib/erlang.erl
Add test test_erlang_loaded
Update CHANGELOG

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

A more memory effective way of getting loaded modules (on BEAM),
used by Elixir 1.20

Add erlang:loaded/0 which returns a list of all currently loaded modules, matching the OTP behavior.

Changes:
Implement erlang:loaded/0 NIF in nifs.c
Register in nifs.gperf
Add Erlang stub with edoc in estdlib/erlang.erl
Add test test_erlang_loaded
Update CHANGELOG

Signed-off-by: Peter M <petermm@gmail.com>
@bettio bettio merged commit 39fbac5 into atomvm:main Mar 18, 2026
210 of 211 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants