[MLton-user] Feature request: MLton.Finalizable

Florian Weimer fw at deneb.enyo.de
Tue Jun 3 00:28:04 PDT 2008


* Matthew Fluet:

> Why would you need both?
>
> If you can remove the finalization functions, then you won't need to
> change the state of the resource, since at an explicit deallocation
> you will first cancel the finalization functions and then really
> delete:
>
>   type res = Int32.int MLton.Finalizable.t
>
>   fun delete res =
>       (MLton.Finalizable.cancelFinalizers res
>        ; MLton.Finalizable.withValue (res, fn r => reallyDelete r))

This makes it difficult to detect use-after-delete on the ML level, I
think.



More information about the MLton-user mailing list