Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize garbage collection by using realloc #939

Conversation

pguyot
Copy link
Collaborator

@pguyot pguyot commented Nov 11, 2023

This is a continuation of #795

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

src/libAtomVM/memory.c Outdated Show resolved Hide resolved
@pguyot pguyot force-pushed the w45/optimize-garbage-collection-by-using-realloc branch 2 times, most recently from 6496fc0 to d8bc636 Compare November 22, 2023 07:19
Most realloc(3) implementation, and esp32 is not exception, can return the
same pointer when shrinking a pointer. This optimization takes this into
account and replaces the second call to memory_gc when shrinking to a call to
a new function that calls realloc(3) and if the pointer moves, rewrite boxed
terms to adjust for the move.

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@pguyot pguyot force-pushed the w45/optimize-garbage-collection-by-using-realloc branch from d8bc636 to 842eb86 Compare January 28, 2024 14:55
@pguyot pguyot marked this pull request as ready for review January 28, 2024 15:01
@bettio bettio changed the base branch from main to release-0.6 April 10, 2024 12:04
@bettio bettio merged commit dffb210 into atomvm:release-0.6 Apr 10, 2024
85 checks passed
@pguyot pguyot deleted the w45/optimize-garbage-collection-by-using-realloc branch April 12, 2024 04:48
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