RE: Alternative Design for Finalisation

20 Sep
2001
20 Sep
'01
8:58 p.m.
At 2001-09-20 04:56, Simon Marlow wrote:
ForeignPtrs are defined like this
data ForeignPtr a = ForeignPtr ForeignObj#
where ForeignObj# is a *boxed* address, it corresponds to a real heap object. The heap object is primitive from the point of view of the compiler - it can't be optimised away. So it works to attach a finalizer to the ForeignObj# (but not to the ForeignPtr!).
OK, you are saying that the ForeignObj# is a representation of a 'Ptr a', but in a way such that the compiler can't optimise away the box. Is that correct? Could ForeignPtr be generalised so that its ForeignObj# could represent any type, rather than just a Ptr? -- Ashley Yakeley, Seattle WA
8644
Age (days ago)
8644
Last active (days ago)
0 comments
1 participants
participants (1)
-
Ashley Yakeley