No way to free a static foreign export
Currently, the dynamic foreign exports created by foreign import ccall "wrapper"
can be freed by freeHaskellFunPtr
, but no similar mechanism exists for static foreign exports created by foreign export ccall
. The exported function's closure is retained via a stable pointer forever. In some use cases, the user may wish to explicitly signal to the RTS that a static foreign export is no longer used and eliminate this retainer.