diff options
author | David Mitchell <davem@iabyn.com> | 2011-05-10 19:06:45 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-05-19 14:49:43 +0100 |
commit | e0171a1a31b0610ebdf32920b0159c22c37e4691 (patch) | |
tree | 5d3ec85de32e94fd75c837142a844d5d030ed275 /embed.fnc | |
parent | ee872193302939c724fd6c2c18071c621bfac6c4 (diff) | |
download | perl-e0171a1a31b0610ebdf32920b0159c22c37e4691.tar.gz |
add hfree_next_entry(), hv_free_ent_ret()
Move body of hfreeentries()' central loop into a new function,
hfree_next_entry(); leaving hfreeentries() as a simple loop that calls
hfree_next_entry() until there are no entries left.
This will in future allow sv_clear() to free a hash iteratively rather
than recursively.
Similarly, turn hv_free_ent() into a thin wrapper around a new function,
hv_free_ent_ret(), which doesn't free HeVAL(), but rather just returns the
SV instead.
Diffstat (limited to 'embed.fnc')
-rw-r--r-- | embed.fnc | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1583,9 +1583,14 @@ s |HV* |require_tie_mod|NN GV *gv|NN const char *varpv|NN SV* namesv \ |NN const char *methpv|const U32 flags #endif +#if defined(PERL_IN_HV_C) || defined(PERL_IN_SV_C) +po |SV* |hfree_next_entry |NN HV *hv|NN STRLEN *indexp +#endif + #if defined(PERL_IN_HV_C) s |void |hsplit |NN HV *hv s |void |hfreeentries |NN HV *hv +s |SV* |hv_free_ent_ret|NN HV *hv|NULLOK HE *entryK sa |HE* |new_he sanR |HEK* |save_hek_flags |NN const char *str|I32 len|U32 hash|int flags sn |void |hv_magic_check |NN HV *hv|NN bool *needs_copy|NN bool *needs_store |