#1991: simplify 'new_callback' op
--------------------+-------------------------------------------------------
Reporter: jimmy | Owner:
Type: RFC | Status: closed
Priority: normal | Milestone:
Component: none | Version: 3.0.0
Severity: medium | Resolution: wontfix
Keywords: | Lang:
Patch: | Platform:
--------------------+-------------------------------------------------------
Changes (by plobsing):
* status: new => closed
* resolution: => wontfix
Comment:
The userdata parameter of a callback is critical to the use of the
callback because it carries critical information about the future
invocation of the callback including the interpreter to use, how to invoke
the callback, and the sub PMC to use. Recall that a C callback does not
necessarily know about the Parrot interpreter and that the parrot
interpreter, upon re-entering has no idea about the nature of the callback
being called. The userdata parameter has a a prophash stuffed with this
data which ensures that the appropriate parts of the parrot invocation are
assembled correctly. Please read src/interp/inter_cb.c for more details.
In the alternative suggested, the only opportunity to stuff the userdata's
prophash would be when the NCI is invoked, which requires the NCI layer to
know about the callback at that point. This requires either additional NCI
parameter signature types that do almost the exact same thing as existing
ones, or deep introspection of NCI arguments; neither of which are good
options.
Another alternative, trampolining, would eliminate parrot's reliance on
userdata callback parameters to get things straight. Unfortunately, to my
knowledge, this cannot be accomplished portably, so we are stuck, in the
general case, with this interface.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/1991#comment:4>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets