Skip to content

Commit c13b3b8

Browse files
committed
Rm Perl_newHV() from mathoms
This function can be converted to call plain newHV without changing its behavior. I verified this by eyeballing its implementation in mathoms.c and comparing that with what happens with just the plain macro. That means embed.fnc can be changed to generate the Perl_ form automatically, and the mathoms function can be removed.
1 parent 10e38d9 commit c13b3b8

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed

embed.fnc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2205,7 +2205,7 @@ ARdp |OP * |newGVOP |I32 type \
22052205
|NN GV *gv
22062206
ARdp |OP * |newGVREF |I32 type \
22072207
|NULLOK OP *o
2208-
AMRbdp |HV * |newHV
2208+
ARdmp |HV * |newHV
22092209
ARdp |HV * |newHVhv |NULLOK HV *hv
22102210
ARdp |OP * |newHVREF |NN OP *o
22112211
ARdmp |IO * |newIO

embed.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2292,6 +2292,7 @@
22922292
# define Perl_hv_store_ent(mTHX,a,b,c,d) hv_store_ent(a,b,c,d)
22932293
# define Perl_hv_store_flags(mTHX,a,b,c,d,e,f) hv_store_flags(a,b,c,d,e,f)
22942294
# define Perl_newAV(mTHX) newAV()
2295+
# define Perl_newHV(mTHX) newHV()
22952296
# define Perl_newIO(mTHX) newIO()
22962297
# define Perl_newSUB(mTHX,a,b,c,d) newSUB(a,b,c,d)
22972298
# define Perl_newSVsv(mTHX,a) newSVsv(a)
@@ -2353,6 +2354,7 @@
23532354
# define Perl_hv_store_ent hv_store_ent
23542355
# define Perl_hv_store_flags hv_store_flags
23552356
# define Perl_newAV newAV
2357+
# define Perl_newHV newHV
23562358
# define Perl_newIO newIO
23572359
# define Perl_newSUB newSUB
23582360
# define Perl_newSVsv newSVsv

mathoms.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,6 @@ Perl_sv_nounlocking(pTHX_ SV *sv)
181181
PERL_UNUSED_ARG(sv);
182182
}
183183

184-
HV *
185-
Perl_newHV(pTHX)
186-
{
187-
HV * const hv = MUTABLE_HV(newSV_type(SVt_PVHV));
188-
assert(!SvOK(hv));
189-
190-
return hv;
191-
}
192-
193184
/*
194185
=for apidoc_section $unicode
195186
=for apidoc utf8_to_uvuni

proto.h

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)