-
Notifications
You must be signed in to change notification settings - Fork 109
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
Fix usage of live in opcodes and no longer preserve registers by default #795
Conversation
acb12d9
to
b22465b
Compare
b22465b
to
139baa0
Compare
139baa0
to
aab2e6b
Compare
aab2e6b
to
73eda50
Compare
We probably have a host of “downstream” nifs in the Ones I can think of:
others? |
73eda50
to
b623659
Compare
As mentioned, no nif in AtomVM needed to be updated. I did check the nifs you mention and they do not need an update either:
|
This nif does not need to be updated after #795 is merged. Also rewrite several lists module functions to not use this nif, either because it was not necessary (`lists:seq/2,3`) or because a non-tail recursive loop is more efficient memory-wise. 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
b623659
to
389676e
Compare
01909d8
to
18c498b
Compare
4acf545
to
c8ec0e2
Compare
c8ec0e2
to
9e06d11
Compare
9e06d11
to
75eb372
Compare
Many opcodes have a live parameter which is the number of registers that should be preserved by GC operations. Take this into account and conversely stop preserving registers by default. This affects significantly the safety of `memory_ensure_free` when writing nifs. Indeed, arguments (which come from registers) are no longer preserved. However, no platform-specific nif was found that needed to be fixed. If required, calls to `memory_ensure_free` or `memory_ensure_free_opt` should be replaced with calls to `memory_ensure_free_with_roots`. Signed-off-by: Paul Guyot <pguyot@kallisys.net>
75eb372
to
b67d320
Compare
…ng-realloc Optimize garbage collection by using realloc *** In addition to Paul's changes, this commit introduces an addition to make it working with newer revisions, also it makes this feature optional and available as experimental already in release-0.6. *** 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
Many opcodes have a live parameter which is the number of registers that should
be preserved by GC operations. Take this into account and conversely stop
preserving registers by default.
This affects significantly the safety of
memory_ensure_free
when writing nifs.Indeed, arguments (which come from registers) are no longer preserved.
However, no platform-specific nif was found that needed to be fixed. If
required, calls to
memory_ensure_free
ormemory_ensure_free_opt
should bereplaced with calls to
memory_ensure_free_with_roots
.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