/* PerlMemShared_free() needs the [ap]PTBLMS_? default values */
#define ptable_store(T, K, V) ptable_store(aPTBLMS_ (T), (K), (V))
-STATIC ptable *sub_op_name = NULL;
+STATIC ptable *so_op_name = NULL;
#ifdef USE_ITHREADS
-STATIC perl_mutex sub_op_name_mutex;
+STATIC perl_mutex so_op_name_mutex;
#endif
typedef struct {
STRLEN len;
char buf;
-} sub_op_name_t;
+} so_op_name_t;
/* --- Public API ---------------------------------------------------------- */
/* --- Private helpers ----------------------------------------------------- */
-STATIC IV sub_op_hint(pTHX) {
-#define sub_op_hint() sub_op_hint(aTHX)
+STATIC IV so_hint(pTHX) {
+#define so_hint() so_hint(aTHX)
SV *hint;
#if SO_HAS_PERL(5, 9, 5)
return (SvOK(hint) && SvIOK(hint)) ? SvIVX(hint) : 0;
}
-STATIC OP *(*sub_op_old_ck_entersub)(pTHX_ OP *) = 0;
+STATIC OP *(*so_old_ck_entersub)(pTHX_ OP *) = 0;
-STATIC OP *sub_op_ck_entersub(pTHX_ OP *o) {
- o = CALL_FPTR(sub_op_old_ck_entersub)(aTHX_ o);
+STATIC OP *so_ck_entersub(pTHX_ OP *o) {
+ o = CALL_FPTR(so_old_ck_entersub)(aTHX_ o);
- if (sub_op_hint()) {
+ if (so_hint()) {
OP *ex_list, *rv2cv, *gvop, *last_arg = NULL;
GV *gv;
}
{
- sub_op_name_t *on = PerlMemShared_malloc(sizeof(*on) + len);
+ so_op_name_t *on = PerlMemShared_malloc(sizeof(*on) + len);
Copy(name, &on->buf, len, char);
(&on->buf)[len] = '\0';
on->len = len;
#ifdef USE_ITHREADS
- MUTEX_LOCK(&sub_op_name_mutex);
+ MUTEX_LOCK(&so_op_name_mutex);
#endif /* USE_ITHREADS */
- ptable_store(sub_op_name, o, on);
+ ptable_store(so_op_name, o, on);
#ifdef USE_ITHREADS
- MUTEX_UNLOCK(&sub_op_name_mutex);
+ MUTEX_UNLOCK(&so_op_name_mutex);
#endif /* USE_ITHREADS */
}
}
return o;
}
-STATIC OP *(*sub_op_old_ck_gelem)(pTHX_ OP *) = 0;
+STATIC OP *(*so_old_ck_gelem)(pTHX_ OP *) = 0;
-STATIC OP *sub_op_ck_gelem(pTHX_ OP *o) {
- o = CALL_FPTR(sub_op_old_ck_entersub)(aTHX_ o);
+STATIC OP *so_ck_gelem(pTHX_ OP *o) {
+ o = CALL_FPTR(so_old_ck_entersub)(aTHX_ o);
- if (sub_op_hint()) {
+ if (so_hint()) {
OP *rv2gv, *gvop;
GV *gv;
BOOT:
{
- sub_op_name = ptable_new();
+ so_op_name = ptable_new();
#ifdef USE_ITHREADS
- MUTEX_INIT(&sub_op_name_mutex);
+ MUTEX_INIT(&so_op_name_mutex);
#endif
MY_CXT_INIT;
MY_CXT.owner = aTHX;
#endif /* SO_THREADSAFE */
- sub_op_old_ck_entersub = PL_check[OP_ENTERSUB];
- PL_check[OP_ENTERSUB] = sub_op_ck_entersub;
- sub_op_old_ck_gelem = PL_check[OP_GELEM];
- PL_check[OP_GELEM] = sub_op_ck_gelem;
+ so_old_ck_entersub = PL_check[OP_ENTERSUB];
+ PL_check[OP_ENTERSUB] = so_ck_entersub;
+ so_old_ck_gelem = PL_check[OP_GELEM];
+ PL_check[OP_GELEM] = so_ck_gelem;
}
#if SO_THREADSAFE
PROTOTYPE: $
PREINIT:
OP *o;
- sub_op_name_t *on;
+ so_op_name_t *on;
PPCODE:
if (!SvROK(op))
XSRETURN_UNDEF;
if (!o || o->op_type != OP_CUSTOM)
XSRETURN_UNDEF;
#ifdef USE_ITHREADS
- MUTEX_LOCK(&sub_op_name_mutex);
+ MUTEX_LOCK(&so_op_name_mutex);
#endif /* USE_ITHREADS */
- on = ptable_fetch(sub_op_name, o);
+ on = ptable_fetch(so_op_name, o);
#ifdef USE_ITHREADS
- MUTEX_UNLOCK(&sub_op_name_mutex);
+ MUTEX_UNLOCK(&so_op_name_mutex);
#endif /* USE_ITHREADS */
if (!on)
XSRETURN_UNDEF;