Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^5: XS malloc and free (whose)

by Brutha (Friar)
on Feb 08, 2006 at 07:08 UTC ( [id://528741]=note: print w/replies, xml ) Need Help??


in reply to Re^4: XS malloc and free (whose)
in thread XS malloc and free

First thanks for all the insight.

That maybe a solution, but not through the preprocessor (code yet untested)

// private external C library with one function #include <stdlib.h> void crt_free(void*p) { free(p); }
link with this and call crt_free() instead of free().

And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
(Terry Pratchett, Small Gods)

Replies are listed 'Best First'.
Re^6: XS malloc and free (whose)
by BrowserUk (Patriarch) on Feb 08, 2006 at 08:08 UTC

    That would work. Just make sure you comment both the little file and wherever you call it from, explaining why you've stuck this indirection wrapper around a CRT call and mentioning that noone must ever include XSUB.h in there. Otherwise someone is going to be very confused by the apparent duplication, or worse back to square one, a year or so from now :)


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://528741]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2024-04-18 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found