diff options
author | bulk88 (via RT) <perlbug-followup@perl.org> | 2012-12-23 18:20:10 -0800 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-01-29 11:16:44 +0000 |
commit | a03199eaa6f5d9e2d15c64750229e2adeebfbdce (patch) | |
tree | 44bc106e72c3d5852de650abf4733893a91203d1 /proto.h | |
parent | 113b1f2cec16524fab70408ae95f289ae8e096d3 (diff) | |
download | perl-a03199eaa6f5d9e2d15c64750229e2adeebfbdce.tar.gz |
hv.c: add some NULL check removal
The purpose is less machine instructions/faster code.
* S_hv_free_ent_ret() is always called with entry non-null: so change its
signature to reflect this, and remove a null check;
* Add some SvREFCNT_dec_NNs;
* In hv_clear(), refactor the code slightly to only do a SvREFCNT_dec_NN
within the branch where its already been determined that the arg is
non-null; also, use the _nocontext variant of Perl_croak() to save
a push instruction in threaded perls.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -5709,9 +5709,10 @@ STATIC struct xpvhv_aux* S_hv_auxinit(HV *hv) STATIC SV* S_hv_delete_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen, int k_flags, I32 d_flags, U32 hash); STATIC SV* S_hv_free_ent_ret(pTHX_ HV *hv, HE *entry) - __attribute__nonnull__(pTHX_1); + __attribute__nonnull__(pTHX_1) + __attribute__nonnull__(pTHX_2); #define PERL_ARGS_ASSERT_HV_FREE_ENT_RET \ - assert(hv) + assert(hv); assert(entry) STATIC void S_hv_magic_check(HV *hv, bool *needs_copy, bool *needs_store) __attribute__nonnull__(1) |