This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Squeeze the context type down to 4 bits, and move the private flags to
[perl5.git] / mathoms.c
index cccaa92..9e1c546 100644 (file)
--- a/mathoms.c
+++ b/mathoms.c
@@ -65,7 +65,9 @@ PERL_CALLCONV void Perl_sv_usepvn_mg(pTHX_ SV *sv, char *ptr, STRLEN len);
 PERL_CALLCONV void Perl_sv_usepvn(pTHX_ SV *sv, char *ptr, STRLEN len);
 PERL_CALLCONV int Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...);
 PERL_CALLCONV int Perl_printf_nocontext(const char *format, ...);
-
+PERL_CALLCONV int Perl_magic_setglob(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV AV * Perl_newAV(pTHX);
+PERL_CALLCONV HV * Perl_newHV(pTHX);
 
 /* ref() is now a macro using Perl_doref;
  * this version provided for binary compatibility only.
@@ -1315,6 +1317,27 @@ Perl_hv_delete(pTHX_ HV *hv, const char *key, I32 klen_i32, I32 flags)
                            NULL, 0);
 }
 
+/* Functions after here were made mathoms post 5.10.0 but pre 5.8.9 */
+
+AV *
+Perl_newAV(pTHX)
+{
+    return (AV*)newSV_type(SVt_PVAV);
+    /* sv_upgrade does AvREAL_only():
+    AvALLOC(av) = 0;
+    AvARRAY(av) = NULL;
+    AvMAX(av) = AvFILLp(av) = -1; */
+}
+
+HV *
+Perl_newHV(pTHX)
+{
+    HV * const hv = (HV*)newSV_type(SVt_PVHV);
+    assert(!SvOK(hv));
+
+    return hv;
+}
+
 #endif /* NO_MATHOMS */
 
 /*