diff options
author | Vincent Pit <perl@profvince.com> | 2009-07-25 18:19:51 +0200 |
---|---|---|
committer | Vincent Pit <perl@profvince.com> | 2009-07-25 23:26:07 +0200 |
commit | af097752b446f87855473ee776be3a2d7b735986 (patch) | |
tree | 93c17080295c2d221724ad333d1280f2fc1f698d /scope.c | |
parent | 75d34a09f38381e487470136b539a7fba0f02b44 (diff) | |
download | perl-af097752b446f87855473ee776be3a2d7b735986.tar.gz |
Introduce save_hdelete() and SAVEHDELETE()
save_hdelete() is just like save_delete() except that it takes an SV instead of char buffer.
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -514,6 +514,21 @@ Perl_save_delete(pTHX_ HV *hv, char *key, I32 klen) } void +Perl_save_hdelete(pTHX_ HV *hv, SV *keysv) +{ + STRLEN len; + I32 klen; + const char *key; + + PERL_ARGS_ASSERT_SAVE_HDELETE; + + key = SvPV_const(keysv, len); + klen = SvUTF8(keysv) ? -(I32)len : (I32)len; + SvREFCNT_inc_simple_void_NN(hv); + save_pushptri32ptr(savepvn(key, len), klen, hv, SAVEt_DELETE); +} + +void Perl_save_adelete(pTHX_ AV *av, I32 key) { dVAR; |