Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

ErlNifEnv should be an empty type #30

Open
nox opened this issue Nov 18, 2017 · 3 comments
Open

ErlNifEnv should be an empty type #30

nox opened this issue Nov 18, 2017 · 3 comments

Comments

@nox
Copy link

nox commented Nov 18, 2017

It is supposed to be opaque. It should at least be of size 0.

@goertzenator
Copy link
Collaborator

The dummy member is not pub; where are you seeing it not be opaque?

  1. The dummy pointer member disables Send and Sync. There are other ways in unstable Rust.

  2. Also at the time of writing I recall an error or warning for empty structs. The recommended alternative was to use an empty enum, but I didn't like the way ErlNifEnv listed an enum in the docs, so stuck with struct. I suspect this may have changed in current Rust.

When both points above can be resolved in stable Rust I'll happily make the struct size 0.

@benoitc
Copy link

benoitc commented Mar 17, 2019

what the status of this?

@goertzenator
Copy link
Collaborator

Unless there's some concrete issue with the current implementation this should be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants