ErlNifEnv should be an empty type
nox opened this issue · 3 comments
nox commented
It is supposed to be opaque. It should at least be of size 0.
goertzenator commented
The dummy member is not pub
; where are you seeing it not be opaque?
-
The dummy pointer member disables
Send
andSync
. There are other ways in unstable Rust. -
Also at the time of writing I recall an error or warning for empty
struct
s. The recommended alternative was to use an emptyenum
, but I didn't like the wayErlNifEnv
listed anenum
in the docs, so stuck withstruct
. 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 commented
what the status of this?
goertzenator commented
Unless there's some concrete issue with the current implementation this should be closed.