Skip to content

Conversation

@pguyot
Copy link
Collaborator

@pguyot pguyot commented Dec 2, 2025

Following OTP, make resources appear as references to Erlang code. Also following OTP, make resources comparable and serializable, with the same properties. For a resource to be properly unserialized, it must still exist in the VM.

Also fix a bug with reference ticks where the top 32 bits were incorrectly handled on 32 bits platforms, yielding collisions of make_ref/0.

This PR does not modify code that manipulates resources to take advantage of this change. For example, socket code now generates sockets as a tuple with two references (the resource and another reference that was added to ease matching when the resource was an empty binary). Optimization of these structures and possible alignment with OTP will be part of a continuation PR.

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

Following OTP, make resources appear as references to Erlang code.
Also following OTP, make resources comparable and serializable, with the same
properties. For a resource to be properly unserialized, it must still exist
in the VM.

Also fix a bug with reference ticks where the top 32 bits were incorrectly
handled on 32 bits platforms, yielding collisions of `make_ref/0`.

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
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.

1 participant