summaryrefslogtreecommitdiff
path: root/mathoms.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-12-20 20:23:45 +0000
committerNicholas Clark <nick@ccl4.org>2007-12-20 20:23:45 +0000
commit78ac7dd9596fbc525d458adec628f7d991dfe43a (patch)
tree06c246ec59c74eb07d3f3c531e209c7ff32ed165 /mathoms.c
parentac572bf4fde55cf563ae338dfe4e12b22ebc6d80 (diff)
downloadperl-78ac7dd9596fbc525d458adec628f7d991dfe43a.tar.gz
Similiarly Perl_newHV() can become a mathom by making newHV() a
wrapper around newSV_type() and tweaking Perl_sv_upgrade(). p4raw-id: //depot/perl@32676
Diffstat (limited to 'mathoms.c')
-rw-r--r--mathoms.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mathoms.c b/mathoms.c
index 3caab1beff..1ea9f346a8 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -67,6 +67,7 @@ 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.
@@ -1338,6 +1339,15 @@ Perl_newAV(pTHX)
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 */
/*