Piers Cawley wrote:

Leopold Toetsch <[EMAIL PROTECTED]> writes:

Here is a proof of concept patchoid:



Fabulous



1) change to your example code:
     $P1 = clone P1
     store_lex 1, "cc", $P1
(the clone strips off all recycle flags)


Oh nice, much neater than what I was thinking of involving making a 'real' continuation and copying context info across from the return continuation.

Yep. That was the reason I rewrote the clone code in the first place.


... Does this pretty much remove the last distinction between
RetContinuation and Continuation?

Pretty much, yes. Continuation still have one relict from COWing times: these are warnings and errors flags buffers. But it's very likely, that COW copying these buffers is wrong too and a plain copy will do it, as it works with all stacks now. When this is removed, RetContinuations and Continuations are the same. It looks like the only distinction might be the creation of the Continuation:


  invokecc   # create Continuation for recycling or
  callemthodcc # same

  newsub $P1, .Continuation, label    # or
  $P1 = clone P1                      # recycling disabled

This OTOH means, that a Continuation created with invokecc shall be never silently reused. There is currently one protection in the code against that: If ever one Continuation is created explicitely, RetContinuation recycling is disabled - forever.

leo




Reply via email to