}
if (!emergency_buffer) {
+ dTHR;
/* First offense, give a possibility to recover by dieing. */
/* No malloc involved here: */
GV **gvp = (GV**)hv_fetch(defstash, "^M", 2, 0);
{
char *shell;
+ MALLOC_INIT;
settmppath();
OS2_Perl_data.xs_init = &Xs_OS2_init;
if (environ == NULL) {
_wildcard(argcp, argvp); \
Perl_OS2_init(env); } STMT_END
-#define PERL_SYS_TERM()
+#define PERL_SYS_TERM() MALLOC_TERM
/* #define PERL_SYS_TERM() STMT_START { \
if (Perl_HAB_set) WinTerminate(Perl_hab); } STMT_END */
if (pthread_key_create(&thr_key, 0))
croak("panic: pthread_key_create");
#endif
- MUTEX_INIT(&malloc_mutex);
MUTEX_INIT(&sv_mutex);
/*
* Safe to use basic SV functions from now on (though
DEBUG_P(debprofdump());
#ifdef USE_THREADS
MUTEX_DESTROY(&sv_mutex);
- MUTEX_DESTROY(&malloc_mutex);
MUTEX_DESTROY(&eval_mutex);
COND_DESTROY(&eval_cond);
# define RUNOPS_DEFAULT runops_standard
#endif
+#ifdef MYMALLOC
+# define MALLOC_INIT MUTEX_INIT(&malloc_mutex)
+# define MALLOC_TERM MUTEX_DESTROY(&malloc_mutex)
+#else
+# define MALLOC_INIT
+# define MALLOC_TERM
+#endif
+
/*
* These need prototyping here because <proto.h> isn't
* included until after runops is initialised.
#define ABORT() kill(getpid(),SIGABRT);
#define BIT_BUCKET "/dev/null"
-#define PERL_SYS_INIT(c,v)
+#define PERL_SYS_INIT(c,v) MALLOC_INIT
#define dXSUB_SYS
-#define PERL_SYS_TERM()
+#define PERL_SYS_TERM() MALLOC_TERM
/*
* fwrite1() should be a routine with the same calling sequence as fwrite(),
#ifndef PERL_SYS_INIT
#ifdef PERL_SCO5
/* this should be set in a hint file, not here */
-# define PERL_SYS_INIT(c,v) fpsetmask(0)
+# define PERL_SYS_INIT(c,v) fpsetmask(0); MALLOC_INIT
#else
-# define PERL_SYS_INIT(c,v)
+# define PERL_SYS_INIT(c,v) MALLOC_INIT
#endif
#endif
#ifndef PERL_SYS_TERM
-#define PERL_SYS_TERM()
+#define PERL_SYS_TERM() MALLOC_TERM
#endif
#define BIT_BUCKET "/dev/null"
#endif
#define BIT_BUCKET "_NLA0:"
-#define PERL_SYS_INIT(c,v) vms_image_init((c),(v))
-#define PERL_SYS_TERM()
+#define PERL_SYS_INIT(c,v) vms_image_init((c),(v)), MALLOC_INIT
+#define PERL_SYS_TERM() MALLOC_TERM
#define dXSUB_SYS
#define HAS_KILL
#define HAS_WAIT