-/* This file is part of the Scope::Upper Perl module.
- * See http://search.cpan.org/dist/Scope-Upper/ */
+/* This file is part of the Thread::Cleanup Perl module.
+ * See http://search.cpan.org/dist/Thread-Cleanup/ */
#define PERL_NO_GET_CONTEXT
#include "EXTERN.h"
#define __PACKAGE__ "Thread::Cleanup"
#define __PACKAGE_LEN__ (sizeof(__PACKAGE__)-1)
+#ifndef ENTER_with_name
+# define ENTER_with_name(N) ENTER
+#endif
+
+#ifndef LEAVE_with_name
+# define LEAVE_with_name(N) LEAVE
+#endif
+
STATIC void tc_callback(pTHX_ void *);
STATIC void tc_callback(pTHX_ void *ud) {
PUSHMARK(SP);
PUTBACK;
- call_pv(__PACKAGE__ "::_CLEANUP", G_VOID);
+ call_pv(__PACKAGE__ "::_CLEANUP", G_VOID | G_EVAL);
- SPAGAIN;
+ PUTBACK;
FREETMPS;
LEAVE;
{
level = PerlMemShared_malloc(sizeof *level);
*level = 1;
- LEAVE;
+ LEAVE_with_name("sub");
SAVEDESTRUCTOR_X(tc_callback, level);
- ENTER;
+ ENTER_with_name("sub");
}