]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - Valgrind.xs
Make the stack trace test of t/20-bad.t more predictable
[perl/modules/Test-Valgrind.git] / Valgrind.xs
index d50485687c63664ffe54b449f9dbf9441c115443..9477f34932e60d88e7692843dd53261b55349b3c 100644 (file)
 # 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