Skip to content

Commit

Permalink
Delete Perl_ptr_table_clear, marked as deprecated since v5.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nwc10 committed Aug 21, 2021
1 parent 73a058a commit 03a62b1
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 44 deletions.
1 change: 0 additions & 1 deletion embed.fnc
Expand Up @@ -2807,7 +2807,6 @@ ApR |void* |ptr_table_fetch|NN PTR_TBL_t *const tbl|NULLOK const void *const sv
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
ApD |void |ptr_table_clear|NULLOK PTR_TBL_t *const tbl
Ap |void |ptr_table_free|NULLOK PTR_TBL_t *const tbl
#if defined(HAVE_INTERP_INTERN)
Ap |void |sys_intern_clear
Expand Down
1 change: 0 additions & 1 deletion embed.h
Expand Up @@ -461,7 +461,6 @@
#define pregfree(a) Perl_pregfree(aTHX_ a)
#define pregfree2(a) Perl_pregfree2(aTHX_ a)
#define prescan_version(a,b,c,d,e,f,g) Perl_prescan_version(aTHX_ a,b,c,d,e,f,g)
#define ptr_table_clear(a) Perl_ptr_table_clear(aTHX_ a)
#define ptr_table_fetch(a,b) Perl_ptr_table_fetch(aTHX_ a,b)
#define ptr_table_free(a) Perl_ptr_table_free(aTHX_ a)
#define ptr_table_new() Perl_ptr_table_new(aTHX)
Expand Down
2 changes: 1 addition & 1 deletion ext/XS-APItest/APItest.pm
Expand Up @@ -4,7 +4,7 @@ use strict;
use warnings;
use Carp;

our $VERSION = '1.18';
our $VERSION = '1.19';

require XSLoader;

Expand Down
4 changes: 0 additions & 4 deletions ext/XS-APItest/APItest.xs
Expand Up @@ -2129,10 +2129,6 @@ void
ptr_table_split(table)
XS::APItest::PtrTable table

void
ptr_table_clear(table)
XS::APItest::PtrTable table

MODULE = XS::APItest::AutoLoader PACKAGE = XS::APItest::AutoLoader

SV *
Expand Down
6 changes: 0 additions & 6 deletions ext/XS-APItest/t/ptr_table.t
Expand Up @@ -36,10 +36,4 @@ cmp_ok($t1->fetch($a), '==', $h, 'Found');
is($t1->fetch($h), 0, 'Not found');
is($t1->fetch($c), 0, 'Not found');

$t1->clear();

is($t1->fetch($a), 0, 'Not found');
is($t1->fetch($h), 0, 'Not found');
is($t1->fetch($c), 0, 'Not found');

done_testing();
3 changes: 2 additions & 1 deletion pod/perldelta.pod
Expand Up @@ -348,7 +348,8 @@ well.

=item *

XXX
C<Perl_ptr_table_clear> has been deleted. This has been marked as deprecated
since v5.14.0 (released in 2011), and is not used by any code on CPAN.

=back

Expand Down
4 changes: 0 additions & 4 deletions proto.h
Expand Up @@ -2824,10 +2824,6 @@ PERL_CALLCONV void Perl_pregfree2(pTHX_ REGEXP *rx);
PERL_CALLCONV const char* Perl_prescan_version(pTHX_ const char *s, bool strict, const char** errstr, bool *sqv, int *ssaw_decimal, int *swidth, bool *salpha);
#define PERL_ARGS_ASSERT_PRESCAN_VERSION \
assert(s)
PERL_CALLCONV void Perl_ptr_table_clear(pTHX_ PTR_TBL_t *const tbl)
__attribute__deprecated__;
#define PERL_ARGS_ASSERT_PTR_TABLE_CLEAR

PERL_CALLCONV void* Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *const tbl, const void *const sv)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_PTR_TABLE_FETCH \
Expand Down
26 changes: 0 additions & 26 deletions sv.c
Expand Up @@ -13976,32 +13976,6 @@ Perl_ptr_table_split(pTHX_ PTR_TBL_t *const tbl)
}
}

/* 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)
{
PERL_UNUSED_CONTEXT;
if (tbl && tbl->tbl_items) {
struct ptr_tbl_arena *arena = tbl->tbl_arena;

Zero(tbl->tbl_ary, tbl->tbl_max + 1, struct ptr_tbl_ent *);

while (arena) {
struct ptr_tbl_arena *next = arena->next;

Safefree(arena);
arena = next;
};

tbl->tbl_items = 0;
tbl->tbl_arena = NULL;
tbl->tbl_arena_next = NULL;
tbl->tbl_arena_end = NULL;
}
}

/* clear and free a ptr table */

void
Expand Down

0 comments on commit 03a62b1

Please sign in to comment.