-static void a_ck_restore(pTHX_ OPCODE type, a_ck_t *old_ck_p) {
-#define a_ck_restore(T, OCP) a_ck_restore(aTHX_ (T), (OCP))
- A_CHECK_LOCK;
- if (*old_ck_p) {
- PL_check[type] = *old_ck_p;
- *old_ck_p = 0;
- }
- A_CHECK_UNLOCK;
-}
-
-/* --- Helpers ------------------------------------------------------------- */
-
-/* ... Thread-safe hints ................................................... */
-
-#if A_WORKAROUND_REQUIRE_PROPAGATION
-
-typedef struct {
- U32 bits;
- IV require_tag;
-} a_hint_t;
-
-#define A_HINT_FREE(H) PerlMemShared_free(H)
-
-#if A_THREADSAFE
-
-#define PTABLE_NAME ptable_hints
-#define PTABLE_VAL_FREE(V) A_HINT_FREE(V)
-
-#define pPTBL pTHX
-#define pPTBL_ pTHX_
-#define aPTBL aTHX
-#define aPTBL_ aTHX_
-
-#include "ptable.h"
-
-#define ptable_hints_store(T, K, V) ptable_hints_store(aTHX_ (T), (K), (V))
-#define ptable_hints_free(T) ptable_hints_free(aTHX_ (T))
-
-#endif /* A_THREADSAFE */
-
-#endif /* A_WORKAROUND_REQUIRE_PROPAGATION */
-
-#define PTABLE_NAME ptable_seen
-#define PTABLE_VAL_FREE(V) NOOP
-
-#include "ptable.h"
-
-/* PerlMemShared_free() needs the [ap]PTBLMS_? default values */
-#define ptable_seen_store(T, K, V) ptable_seen_store(aPTBLMS_ (T), (K), (V))
-#define ptable_seen_clear(T) ptable_seen_clear(aPTBLMS_ (T))
-#define ptable_seen_free(T) ptable_seen_free(aPTBLMS_ (T))
-
-#define MY_CXT_KEY __PACKAGE__ "::_guts" XS_VERSION
-
-typedef struct {
-#if A_THREADSAFE && A_WORKAROUND_REQUIRE_PROPAGATION
- ptable *tbl; /* It really is a ptable_hints */
- tTHX owner;
-#endif /* A_THREADSAFE && A_WORKAROUND_REQUIRE_PROPAGATION */
- ptable *seen; /* It really is a ptable_seen */
-} my_cxt_t;
-
-START_MY_CXT
-
-#if A_THREADSAFE
-
-#if A_WORKAROUND_REQUIRE_PROPAGATION
-
-typedef struct {
- ptable *tbl;
-#if A_HAS_PERL(5, 13, 2)
- CLONE_PARAMS *params;
-#else
- CLONE_PARAMS params;
-#endif
-} a_ptable_clone_ud;
-
-#if A_HAS_PERL(5, 13, 2)
-# define a_ptable_clone_ud_init(U, T, O) \
- (U).tbl = (T); \
- (U).params = Perl_clone_params_new((O), aTHX)
-# define a_ptable_clone_ud_deinit(U) Perl_clone_params_del((U).params)
-# define a_dup_inc(S, U) SvREFCNT_inc(sv_dup((S), (U)->params))
-#else
-# define a_ptable_clone_ud_init(U, T, O) \
- (U).tbl = (T); \
- (U).params.stashes = newAV(); \
- (U).params.flags = 0; \
- (U).params.proto_perl = (O)
-# define a_ptable_clone_ud_deinit(U) SvREFCNT_dec((U).params.stashes)
-# define a_dup_inc(S, U) SvREFCNT_inc(sv_dup((S), &((U)->params)))