Skip to content

Add support for process_info/1 and process_info/2 with list argument#2219

Open
mfurga wants to merge 1 commit intoatomvm:release-0.7from
mfurga:mfurga/nif-erlang-process_info
Open

Add support for process_info/1 and process_info/2 with list argument#2219
mfurga wants to merge 1 commit intoatomvm:release-0.7from
mfurga:mfurga/nif-erlang-process_info

Conversation

@mfurga
Copy link
Copy Markdown
Contributor

@mfurga mfurga commented Mar 20, 2026

Add support for process_info/1 and process_info/2 with list argument.

Fixes #2190 #2191

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

term ret = term_invalid_term();
if (ctx == target) {
size_t term_size;
if (UNLIKELY(!context_get_process_info(ctx, NULL, &term_size, item, NULL))) {

Check failure

Code scanning / CodeQL

Allocations without ensure_free in NIFs and port handlers Error

Call to context_get_process_info allocates without any preceding ensure_free in NIF
nif_erlang_process_info
.
size_t total_size = 0;
for (size_t i = 0; i < items_len; i++) {
size_t item_size;
if (UNLIKELY(!context_get_process_info(ctx, NULL, &item_size, items[i], NULL))) {

Check failure

Code scanning / CodeQL

Allocations without ensure_free in NIFs and port handlers Error

Call to context_get_process_info allocates without any preceding ensure_free in NIF
nif_erlang_process_info
.
@mfurga mfurga force-pushed the mfurga/nif-erlang-process_info branch from 73a8f25 to da6a4f1 Compare March 20, 2026 15:35
@bettio bettio added the popcorn label Mar 20, 2026
@bettio bettio added this to the v0.7.0 milestone Mar 20, 2026
CHANGELOG.md Outdated
`atomvm:posix_pwrite/3`, `atomvm:posix_fsync/1`, `atomvm:posix_ftruncate/2`,
`atomvm:posix_rename/2`, `atomvm:posix_stat/1`, `atomvm:posix_fstat/1`
- Added POSIX directory functions: `atomvm:posix_mkdir/1`, `atomvm:posix_rmdir/1`,
- Added support for `process_info/1` and `process_info/2` with list argument
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we branched out release-0.7 this has to be rebased on top of release-0.7 branch.
Also make sure to switch from main to release-0.7 also here on github.
After that you have to add this to a new changelog section, in case you are adding the first new feature for alpha.1:

## [0.7.0-alpha.1] - Unreleased

### Added
- Added support for `process_info/1` and `process_info/2` with list argument

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@mfurga mfurga changed the base branch from main to release-0.7 March 23, 2026 12:18
@mfurga mfurga force-pushed the mfurga/nif-erlang-process_info branch from da6a4f1 to 901402b Compare March 23, 2026 12:18
@mfurga mfurga requested a review from bettio March 23, 2026 12:19
Signed-off-by: Mateusz Furga <mateusz.furga@swmansion.com>
@mfurga mfurga force-pushed the mfurga/nif-erlang-process_info branch from 901402b to 125b736 Compare March 26, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement erlang:process_info/1

3 participants