Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: XS replacing my c library, not compatible with OS threads

by BrowserUk (Patriarch)
on Dec 01, 2010 at 11:08 UTC ( [id://874644]=note: print w/replies, xml ) Need Help??


in reply to Re^3: XS replacing my c library, not compatible with OS threads
in thread XS replacing my c library, not compatible with OS threads

Shame it doesn't work with my compiler :(

Actually doing the expansion isn't hard:

C:\test>type expand_malloc.c #include "EXTERN.h" #include "perl.h" char *p = malloc( 10 ); C:\test> cl -E -nologo -GF -W3 -MD -Zi -DNDEBUG -Ox -GL -Wp64 -fp:prec +ise -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DWIN64 -DCONSER +VATIVE -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONT +EXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -D +NDEBUG -Ox -GL -Wp64 -fp:precise -DVERSION=\"1.76\" -DXS_VERSION= +\"1.76\" "-IC:\Perl64\lib\CORE" -DHAS_PPPORT_H expand_malloc.c >jun +k.txt

And if you load up the output file junk.txt, and wade you way down to line: 203,525 (Yes! That really is line: two hundred and three thousand five hundred and twenty five!), you get:

[203524 lines omitted :)] #line 3 "expand_malloc.c" char *p = malloc( 10 );

which probably means I've got the wrong set of defines on the command line :(

Update: Of course. I forgot to include XSUB.h:

... #line 4 "expand_malloc.c" char *p = (*(*Perl_IMem_ptr(((PerlInterpreter *)Perl_get_context())))- +>pMalloc)((*Perl_IMem_ptr(((PerlInterpreter *)Perl_get_context()))), +(10));

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"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://874644]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-19 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found