[perl #45695] [PATCH] Remove seemingly unnecessary Parrot_cont->from_ctx
Will Coleda via RT
parrotbug-followup at parrotcode.org
Mon Nov 24 21:58:49 UTC 2008
On Sun Sep 23 11:19:14 2007, bgeron at gmail.com wrote:
> Parrot_cont (the internal structure storing info about
> (Ret)Continuations) has two fields 'to_ctx' and 'from_ctx'. 'to_ctx'
> stores the context that should be active after invoking the
> Continuation, but I don't know what 'from_ctx' is supposed to hold
(the
> context it was made in? the context it was called from?)
>
> To test if 'from_ctx' is redundant, I tried removing the field and all
> accesses to it, and no extra tests failed (see patch). I think we can
> safely remove the field, if nobody objects.
>
> The patch slightly modifies invalidate_retc_context (which makes sure
we
> don't get a Continuation that continues to a RetContinuation, that
would
> be illegal) to explicitly end the loop when we get to the topmost
> context. If it wouldn't, Parrot segfaults with from_ctx removed.
Rejecting patch, based on Patrick Michaud's recent delving into
continutation guts - turns out we do need the from_ctx. Patrick says,
"at present, it's the only way for a continuation to know its current
context."
Thanks for the patch, though!
--
Will "Coke" Coleda
More information about the parrot-dev
mailing list