[Gd-hackers] Suggested patch for Open Dylan's C runtime

Thomas Christian Chust chust at web.de
Tue Jul 31 00:06:29 CEST 2007


Thomas Christian Chust wrote:
> Bruce Hoult wrote:
> 
>> [...]
>> You could allocate the list link for the object at the point that you
>> register the finalizer for it (possibly as part of the object itself
>> if you have control over that by, for example, allocating an extra 4
>> bytes and lying to the rest of Dylan about where the object starts).
> 
> Hello,
> 
> I've attached a new patch replacing the other one which implements the
> finalization queue as a dynamically sized array with resizing operations
> taking place only as necessary in primitive_mps_finalize and
> primitive_mps_finalization_queue_first. It seems to work just as well as
> the first patch on my machine and I hope it is safer :-)
> [...]

Hello,

I guess I shouldn't hack such stuff together when in a hurry. A much
easier solution which also avoid allocation inside the finalization
procedure is possible by simply using the data argument to that
procedure to supply a preallocated cons cell.

So here is another patch, replacing the earlier ones, and I apologize
for not thinking before coding %-]

cu,
Thomas
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: opendylan-finalization.patch
Url: http://www.opendylan.org/pipermail/hackers/attachments/20070731/54db340e/attachment-0001.txt 


More information about the hackers mailing list