[m-rev.] more LLDS accurate GC fixes
Peter Moulder
Peter.Moulder at infotech.monash.edu.au
Wed Oct 15 14:20:12 AEST 2003
On Tue, Oct 14, 2003 at 02:34:59AM +1000, Fergus Henderson wrote:
> runtime/mercury_deep_copy_body.h:
> Don't abort when trying to copy foreign types,
> unless the foreign type happens to point into the Mercury heap.
Excuse my not looking too hard at the nature of this change; I'll just
ask a question to which hopefully the answer is simply "not a problem".
Could this create a problem for foreign types that are pointers, where
the implementor of the foreign code was using uniqueness on the mercury side
to keep a pure semantics?
I.e. does it allow the following code to run without a runtime error?
copy(!.Ptr, !:PtrCopy),
write_to_the_memory_pointed_to_by(!Ptr),
read_from_the_memory_pointed_to_by(!.PtrCopy, X)
where
:- mode write_to_the_memory_pointed_to_by(di, uo) is det.
:- mode read_from_the_memory_pointed_to_by(ui, out) is det.
If that code is broken after this change (or even if it was broken even
before this change), what is the right way of implementing a foreign
type too big for pass-by-value, or for variable-size foreign types?
pjm.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list