#include "EXTERN.h"
#define PERL_IN_PERL_C
#include "perl.h"
+#include "patchlevel.h" /* for local_patches */
/* XXX If this causes problems, set i_unistd=undef in the hint file. */
#ifdef I_UNISTD
{
PerlInterpreter *my_perl;
- New(53, my_perl, 1, PerlInterpreter);
+ /* New() needs interpreter, so call malloc() instead */
+ my_perl = (PerlInterpreter*)PerlMem_malloc(sizeof(PerlInterpreter));
PERL_SET_INTERP(my_perl);
return my_perl;
}
Zero(my_perl, 1, PerlInterpreter);
#endif
+#ifdef MULTIPLICITY
+ init_interp();
+ PL_perl_destruct_level = 1;
+#else
+ if (PL_perl_destruct_level > 0)
+ init_interp();
+#endif
+
/* Init the real globals (and main thread)? */
if (!PL_linestr) {
#ifdef USE_THREADS
PL_rs = SvREFCNT_inc(PL_nrs);
init_stacks();
-#ifdef MULTIPLICITY
- init_interp();
- PL_perl_destruct_level = 1;
-#else
- if (PL_perl_destruct_level > 0)
- init_interp();
-#endif
init_ids();
PL_lex_state = LEX_NOTPARSING;
Safefree(PL_screamnext);
PL_screamnext = 0;
+ /* float buffer */
+ Safefree(PL_efloatbuf);
+ PL_efloatbuf = Nullch;
+ PL_efloatsize = 0;
+
/* startup and shutdown function lists */
SvREFCNT_dec(PL_beginav);
SvREFCNT_dec(PL_endav);
perl_free(pTHXx)
{
#if defined(PERL_OBJECT)
- Safefree(this);
+ PerlMem_free(this);
#else
- Safefree(aTHXx);
+ PerlMem_free(aTHXx);
#endif
}
CvPADLIST(PL_compcv) = comppadlist;
boot_core_UNIVERSAL();
+ boot_core_xsutils();
if (xsinit)
(*xsinit)(aTHXo); /* in case linked C routines want magical variables */
# define PERLVAR(var,type)
# define PERLVARA(var,n,type)
# if defined(PERL_IMPLICIT_CONTEXT)
-# define PERLVARI(var,type,init) my_perl->var = init;
-# define PERLVARIC(var,type,init) my_perl->var = init;
+# if defined(USE_THREADS)
+# define PERLVARI(var,type,init) PERL_GET_INTERP->var = init;
+# define PERLVARIC(var,type,init) PERL_GET_INTERP->var = init;
+# else /* !USE_THREADS */
+# define PERLVARI(var,type,init) aTHX->var = init;
+# define PERLVARIC(var,type,init) aTHX->var = init;
+# endif /* USE_THREADS */
# else
# define PERLVARI(var,type,init) PERL_GET_INTERP->var = init;
# define PERLVARIC(var,type,init) PERL_GET_INTERP->var = init;
STATIC void
S_init_ids(pTHX)
{
- PL_uid = (int)PerlProc_getuid();
- PL_euid = (int)PerlProc_geteuid();
- PL_gid = (int)PerlProc_getgid();
- PL_egid = (int)PerlProc_getegid();
+ PL_uid = PerlProc_getuid();
+ PL_euid = PerlProc_geteuid();
+ PL_gid = PerlProc_getgid();
+ PL_egid = PerlProc_getegid();
#ifdef VMS
PL_uid |= PL_gid << 16;
PL_euid |= PL_egid << 16;