Inline the necessary parts of Perl_ptr_table_clear() into Perl_ptr_table_free().
No need to reset memory to zero that is about to be freed anyway.
Ap |void |ptr_table_store|NN PTR_TBL_t *const tbl|NULLOK const void *const oldsv \
|NN void *const newsv
Ap |void |ptr_table_split|NN PTR_TBL_t *const tbl
-Ap |void |ptr_table_clear|NULLOK PTR_TBL_t *const tbl
+ApD |void |ptr_table_clear|NULLOK PTR_TBL_t *const tbl
Ap |void |ptr_table_free|NULLOK PTR_TBL_t *const tbl
#if defined(USE_ITHREADS)
# if defined(HAVE_INTERP_INTERN)
#define PERL_ARGS_ASSERT_PTR_TABLE_SPLIT \
assert(tbl)
-PERL_CALLCONV void Perl_ptr_table_clear(pTHX_ PTR_TBL_t *const tbl);
+PERL_CALLCONV void Perl_ptr_table_clear(pTHX_ PTR_TBL_t *const tbl)
+ __attribute__deprecated__;
+
PERL_CALLCONV void Perl_ptr_table_free(pTHX_ PTR_TBL_t *const tbl);
#if defined(USE_ITHREADS)
# if defined(HAVE_INTERP_INTERN)
}
/* remove all the entries from a ptr table */
+/* Deprecated - will be removed post 5.14 */
void
Perl_ptr_table_clear(pTHX_ PTR_TBL_t *const tbl)
void
Perl_ptr_table_free(pTHX_ PTR_TBL_t *const tbl)
{
+ struct ptr_tbl_arena *arena;
+
if (!tbl) {
return;
}
- ptr_table_clear(tbl);
+
+ arena = tbl->tbl_arena;
+
+ while (arena) {
+ struct ptr_tbl_arena *next = arena->next;
+
+ Safefree(arena);
+ arena = next;
+ }
+
Safefree(tbl->tbl_ary);
Safefree(tbl);
}