summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2007-02-19 21:41:07 +0200
committerSteve Peters <steve@fisharerojo.org>2007-02-19 20:51:10 +0000
commitbae1192d8838abbb774747207533573c1bc72f97 (patch)
tree3094225ad106e44d36de4623cef253bb1e02b4ee
parented756621b7e346dcad5b51c1e9d060d1fe530fae (diff)
downloadperl-bae1192d8838abbb774747207533573c1bc72f97.tar.gz
blead (honestly :-) g++ with -DPERL_GLOBAL_STRUCT_PRIVATE needs tweaking
Message-Id: <20070219174107.63EEB43A67@anubis.hut.fi> Plus a regen picked up changes in pod/perlapi.pod related to change #30347. p4raw-id: //depot/perl@30362
-rw-r--r--opcode.h3
-rwxr-xr-xopcode.pl3
-rw-r--r--pod/perlapi.pod11
-rw-r--r--sv.c4
-rw-r--r--util.c27
5 files changed, 33 insertions, 15 deletions
diff --git a/opcode.h b/opcode.h
index 0c5eb30e8c..df4a6dce21 100644
--- a/opcode.h
+++ b/opcode.h
@@ -1898,7 +1898,8 @@ EXTCONST U32 PL_opargs[] = {
};
#endif
+#endif /* !PERL_GLOBAL_STRUCT_INIT */
+
END_EXTERN_C
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
/* ex: set ro: */
diff --git a/opcode.pl b/opcode.pl
index 1c8245c92c..995ed4f2f0 100755
--- a/opcode.pl
+++ b/opcode.pl
@@ -365,9 +365,10 @@ print <<END;
};
#endif
+#endif /* !PERL_GLOBAL_STRUCT_INIT */
+
END_EXTERN_C
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
END
if (keys %OP_IS_SOCKET) {
diff --git a/pod/perlapi.pod b/pod/perlapi.pod
index 4ebc353db1..00468b6be9 100644
--- a/pod/perlapi.pod
+++ b/pod/perlapi.pod
@@ -5065,6 +5065,17 @@ The reference count for the SV is set to 1.
=for hackers
Found in file sv.c
+=item newSV_type
+X<newSV_type>
+
+Creates a new SV, of the type specificied. The reference count for the new SV
+is set to 1.
+
+ SV* newSV_type(svtype type)
+
+=for hackers
+Found in file sv.c
+
=item sv_2bool
X<sv_2bool>
diff --git a/sv.c b/sv.c
index 77627bda98..f2a7773f54 100644
--- a/sv.c
+++ b/sv.c
@@ -11120,14 +11120,14 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
Newx(PL_my_cxt_list, PL_my_cxt_size, void *);
Copy(proto_perl->Imy_cxt_list, PL_my_cxt_list, PL_my_cxt_size, void *);
#ifdef PERL_GLOBAL_STRUCT_PRIVATE
- Newx(PL_my_cxt_keys, PL_my_cxt_size, char *);
+ Newx(PL_my_cxt_keys, PL_my_cxt_size, const char *);
Copy(proto_perl->Imy_cxt_keys, PL_my_cxt_keys, PL_my_cxt_size, char *);
#endif
}
else {
PL_my_cxt_list = (void**)NULL;
#ifdef PERL_GLOBAL_STRUCT_PRIVATE
- PL_my_cxt_keys = (void**)NULL;
+ PL_my_cxt_keys = (const char**)NULL;
#endif
}
PL_modglobal = hv_dup_inc(proto_perl->Imodglobal, param);
diff --git a/util.c b/util.c
index d23dc8a8e3..3c5518339e 100644
--- a/util.c
+++ b/util.c
@@ -5158,13 +5158,14 @@ Perl_stashpv_hvname_match(pTHX_ const COP *c, const HV *hv)
#ifdef PERL_GLOBAL_STRUCT
+#define PERL_GLOBAL_STRUCT_INIT
+#include "opcode.h" /* the ppaddr and check */
+
struct perl_vars *
Perl_init_global_struct(pTHX)
{
struct perl_vars *plvarsp = NULL;
-#ifdef PERL_GLOBAL_STRUCT
-# define PERL_GLOBAL_STRUCT_INIT
-# include "opcode.h" /* the ppaddr and check */
+# ifdef PERL_GLOBAL_STRUCT
const IV nppaddr = sizeof(Gppaddr)/sizeof(Perl_ppaddr_t);
const IV ncheck = sizeof(Gcheck) /sizeof(Perl_check_t);
# ifdef PERL_GLOBAL_STRUCT_PRIVATE
@@ -5192,10 +5193,14 @@ Perl_init_global_struct(pTHX)
# undef PERLVARIC
# undef PERLVARISC
# ifdef PERL_GLOBAL_STRUCT
- plvarsp->Gppaddr = PerlMem_malloc(nppaddr * sizeof(Perl_ppaddr_t));
+ plvarsp->Gppaddr =
+ (Perl_ppaddr_t*)
+ PerlMem_malloc(nppaddr * sizeof(Perl_ppaddr_t));
if (!plvarsp->Gppaddr)
exit(1);
- plvarsp->Gcheck = PerlMem_malloc(ncheck * sizeof(Perl_check_t));
+ plvarsp->Gcheck =
+ (Perl_check_t*)
+ PerlMem_malloc(ncheck * sizeof(Perl_check_t));
if (!plvarsp->Gcheck)
exit(1);
Copy(Gppaddr, plvarsp->Gppaddr, nppaddr, Perl_ppaddr_t);
@@ -5204,8 +5209,8 @@ Perl_init_global_struct(pTHX)
# ifdef PERL_SET_VARS
PERL_SET_VARS(plvarsp);
# endif
-# undef PERL_GLOBAL_STRUCT_INIT
-#endif
+# undef PERL_GLOBAL_STRUCT_INIT
+# endif
return plvarsp;
}
@@ -5216,16 +5221,16 @@ Perl_init_global_struct(pTHX)
void
Perl_free_global_struct(pTHX_ struct perl_vars *plvarsp)
{
-#ifdef PERL_GLOBAL_STRUCT
+# ifdef PERL_GLOBAL_STRUCT
# ifdef PERL_UNSET_VARS
PERL_UNSET_VARS(plvarsp);
# endif
free(plvarsp->Gppaddr);
free(plvarsp->Gcheck);
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
+# ifdef PERL_GLOBAL_STRUCT_PRIVATE
free(plvarsp);
-# endif
-#endif
+# endif
+# endif
}
#endif /* PERL_GLOBAL_STRUCT */