We don't have a way to add a finalizer to release whatever is in the user_data field.
Steps To Reproduce
Read nix_alloc_primop signature. It can't release the user_data.
Expected behavior
Nix provides a way to set a finalizer, either in the nix_alloc_primop function (or variant of it), or we can nix_primop_set_finalizer immediately after.
nix-env --version output
Additional context
This is most relevant when allocating many primops.
This is less relevant when the primops are only registered as builtins, in which case you could tie the lifetime of the user_data to the thing that holds your EvalState.
Describe the bug
We don't have a way to add a finalizer to release whatever is in the
user_data
field.Steps To Reproduce
Read
nix_alloc_primop
signature. It can't release theuser_data
.Expected behavior
Nix provides a way to set a finalizer, either in the
nix_alloc_primop
function (or variant of it), or we cannix_primop_set_finalizer
immediately after.nix-env --version
outputAdditional context
This is most relevant when allocating many primops.
This is less relevant when the primops are only registered as builtins, in which case you could tie the lifetime of the
user_data
to the thing that holds yourEvalState
.Priorities
Add :+1: to issues you find important.