]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - Valgrind.xs
Update VPIT::TestHelpers to 15e8aee3
[perl/modules/Test-Valgrind.git] / Valgrind.xs
index 9477f34932e60d88e7692843dd53261b55349b3c..137ddf0b77616777f8e7e4b9322148ed22840f7b 100644 (file)
@@ -1,5 +1,5 @@
-/* This file is part of the Scalar::Vec::Util Perl module.
- * See http://search.cpan.org/dist/Scalar-Vec-Util/ */
+/* This file is part of the Test::Valgrind Perl module.
+ * See http://search.cpan.org/dist/Test::Valgrind/ */
 
 #define PERL_NO_GET_CONTEXT
 #include "EXTERN.h"
 
 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 *