X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Valgrind.xs;h=9477f34932e60d88e7692843dd53261b55349b3c;hb=9958ed1ff946c17a02c3e4eb49e5fd3a4fc56ba6;hp=d50485687c63664ffe54b449f9dbf9441c115443;hpb=8d66aa098b18f8c9724b12bf446d330905122c57;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/Valgrind.xs b/Valgrind.xs index d504856..9477f34 100644 --- a/Valgrind.xs +++ b/Valgrind.xs @@ -16,7 +16,13 @@ # define DEBUGGING 0 #endif -const char *tvtxs_leaky = NULL; +const char *tv_leaky = NULL; + +extern void tv_leak(void) { + tv_leaky = malloc(10000); + + return; +} /* --- XS ------------------------------------------------------------------ */ @@ -33,14 +39,14 @@ BOOT: void leak() CODE: - Newx(tvtxs_leaky, 10000, char); + tv_leak(); XSRETURN_UNDEF; SV * notleak(SV *sv) CODE: - Newx(tvtxs_leaky, 10000, char); - Safefree(tvtxs_leaky); + Newx(tv_leaky, 10000, char); + Safefree(tv_leaky); RETVAL = newSVsv(sv); OUTPUT: RETVAL