This hasn't been used since
626725768b7b17463e9ec7b92e2da37105036252
Author: Nicholas Clark <nick@ccl4.org>
Date: Thu May 26 22:29:40 2011 -0600
regcomp.c: Fix memory leak regression
here was a remaining memory leak in the new inversion lists data
structure under threading. This solves it by changing the
implementation to use a SVpPV instead of doing our own memory
management. Then the already existing code for handling SVs
returns the memory when done.
EiMR |UV |invlist_len |NN SV* const invlist
EiMR |UV |invlist_max |NN SV* const invlist
EiM |void |invlist_set_len |NN SV* const invlist|const UV len
-EiM |void |invlist_set_max |NN SV* const invlist|const UV max
EiM |void |invlist_trim |NN SV* const invlist
EsM |void |invlist_union |NN SV* const a|NN SV* const b|NN SV** output
#endif
#define invlist_len(a) S_invlist_len(aTHX_ a)
#define invlist_max(a) S_invlist_max(aTHX_ a)
#define invlist_set_len(a,b) S_invlist_set_len(aTHX_ a,b)
-#define invlist_set_max(a,b) S_invlist_set_max(aTHX_ a,b)
#define invlist_trim(a) S_invlist_trim(aTHX_ a)
#define invlist_union(a,b,c) S_invlist_union(aTHX_ a,b,c)
#define join_exact(a,b,c,d,e,f) S_join_exact(aTHX_ a,b,c,d,e,f)
#define PERL_ARGS_ASSERT_INVLIST_SET_LEN \
assert(invlist)
-PERL_STATIC_INLINE void S_invlist_set_max(pTHX_ SV* const invlist, const UV max)
- __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_INVLIST_SET_MAX \
- assert(invlist)
-
PERL_STATIC_INLINE void S_invlist_trim(pTHX_ SV* const invlist)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_INVLIST_TRIM \
SvCUR_set(invlist, len * sizeof(UV));
}
-PERL_STATIC_INLINE void
-S_invlist_set_max(pTHX_ SV* const invlist, const UV max)
-{
-
- /* Sets the maximum number of elements storable in the inversion list
- * without having to realloc() */
-
- PERL_ARGS_ASSERT_INVLIST_SET_MAX;
-
- if (max < invlist_len(invlist)) {
- Perl_croak(aTHX_ "panic: Can't make max size '%"UVuf"' less than current length %"UVuf" in inversion list", invlist_max(invlist), invlist_len(invlist));
- }
-
- SvLEN_set(invlist, max * sizeof(UV));
-}
-
#ifndef PERL_IN_XSUB_RE
SV*
Perl__new_invlist(pTHX_ IV initial_size)