You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is the users responsibility to close(2) eBPF map and program file descriptors via ebpf_{maps,user}:close/1.
It would be safer and more convenient if these FDs were to close automatically when no longer needed.
There easiest solution would be to use Erlang NIF "resources" for maps/programs instead just passing an integer FD back to BEAM.
NIF resources can have a destructor-like callback that is called from the garbage collector when the resource is no longer in use, which is where we can close the FD.
Another path would be to drop the NIFs entirely and use an Erlang port driver to represent maps/programs. That would allow for closing the FDs when the owner Erlang process of the map/program dies.
The text was updated successfully, but these errors were encountered:
Currently it is the users responsibility to
close(2)
eBPF map and program file descriptors viaebpf_{maps,user}:close/1
.It would be safer and more convenient if these FDs were to close automatically when no longer needed.
There easiest solution would be to use Erlang NIF "resources" for maps/programs instead just passing an integer FD back to BEAM.
NIF resources can have a destructor-like callback that is called from the garbage collector when the resource is no longer in use, which is where we can close the FD.
Another path would be to drop the NIFs entirely and use an Erlang port driver to represent maps/programs. That would allow for closing the FDs when the owner Erlang process of the map/program dies.
The text was updated successfully, but these errors were encountered: