X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Valgrind.xs;h=137ddf0b77616777f8e7e4b9322148ed22840f7b;hb=60c3814cf8faecbe1ac93757f66147d7c2de54a7;hp=b2108a2a58f5915280ce41f7738969777738368a;hpb=bca85461fd8f34e21d6b1f4deb8b313c3771880d;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/Valgrind.xs b/Valgrind.xs index b2108a2..137ddf0 100644 --- a/Valgrind.xs +++ b/Valgrind.xs @@ -18,7 +18,19 @@ const char *tv_leaky = NULL; -extern void tv_leak(void) { +/* malloc() on Windows needs the current interpreter. */ + +#ifdef PERL_IMPLICIT_SYS +# define TV_LEAK_PROTO pTHX +# define TV_LEAK_ARG aTHX +#else +# define TV_LEAK_PROTO void +# define TV_LEAK_ARG +#endif + +extern void tv_leak(TV_LEAK_PROTO); + +extern void tv_leak(TV_LEAK_PROTO) { tv_leaky = malloc(10000); return; @@ -39,7 +51,7 @@ BOOT: void leak() CODE: - tv_leak(); + tv_leak(TV_LEAK_ARG); XSRETURN_UNDEF; SV *