Skip to content

Commit

Permalink
Merge pull request #690 from bettio/add-cons-size
Browse files Browse the repository at this point in the history
Add cons size constant + fix typo

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
  • Loading branch information
bettio committed Jul 16, 2023
2 parents 8a434fa + b1fbf30 commit 299fa6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libAtomVM/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ static void memory_scan_and_copy(HeapFragment *old_fragment, term *mem_start, co
TRACE("- Found refc binary.\n");
term ref = ((term) ptr) | TERM_BOXED_VALUE_TAG;
if (!term_refc_binary_is_const(ref)) {
*mso_list = term_list_init_prepend(ptr + REFC_BINARY_CONS_OFFET, ref, *mso_list);
*mso_list = term_list_init_prepend(ptr + REFC_BINARY_CONS_OFFSET, ref, *mso_list);
}
break;
}
Expand Down
3 changes: 2 additions & 1 deletion src/libAtomVM/term.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ extern "C" {
#define FLOAT_SIZE (sizeof(float_term_t) / sizeof(term) + 1)
#define REF_SIZE ((int) ((sizeof(uint64_t) / sizeof(term)) + 1))
#define TUPLE_SIZE(elems) ((int) (elems + 1))
#define REFC_BINARY_CONS_OFFET 4
#define CONS_SIZE 2
#define REFC_BINARY_CONS_OFFSET 4

#define TERM_BINARY_SIZE_IS_HEAP(size) ((size) < REFC_BINARY_MIN)

Expand Down

0 comments on commit 299fa6a

Please sign in to comment.