At 5:44 PM -0400 8/9/04, Matt Fowles wrote:
Dan~


On Mon, 9 Aug 2004 17:22:18 -0400, Dan Sugalski <[EMAIL PROTECTED]> wrote:
 At 12:04 PM -0400 8/9/04, Dan Sugalski wrote:
 >Since we're running into Ponie issues with this, which means we'll
 >run into Apache issues as well as any number of other systems....
 >
 >When Parrot's being embedded I can see the following functions
 >needing overriding by the embedder:
 >
 >*) Memory: malloc, realloc, calloc, free
 >*) Signals: handler register, Handler un-register, signal raise, alarm set
 >*) Files: Open, close, seek, tell, read, write. (Possibly asynchronously)

 And we want to add exiting to that list. Which presents some
 interesting issues we need to think about, since we probably need to
 throw an exit exception instead.


Would having a table of function pointers for these various functions be an appropriate solution, or does that have issues that I am not seeing? We could then initialize them ourselves at startup (even using different allocaters based on commandline switches) and then provide routines to set these later (if someone wanted to do it that way).

A global table of functions is an excellent way to go about this, and what we should do ourselves internally. Having a:


Parrot_Override_Function(INTVAL funcnum, (wacky function pointer cast)funcptr)

entry in the embedding API wouldn't be out of order either, I think.
--
                                Dan

--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to