return val;
}
+STATIC void lt_map_delete(pTHX_ const OP *o) {
+#define lt_map_delete(O) lt_map_delete(aTHX_ (O))
+#ifdef USE_ITHREADS
+ MUTEX_LOCK(<_op_map_mutex);
+#endif
+
+ ptable_map_store(lt_op_map, o, NULL);
+
+#ifdef USE_ITHREADS
+ MUTEX_UNLOCK(<_op_map_mutex);
+#endif
+}
+
/* --- Hooks --------------------------------------------------------------- */
/* ... Our pp_padsv ........................................................ */
lt_pp_padsv_save();
lt_map_store(o, orig_pkg, type_pkg, type_meth, lt_pp_padsv_saved);
+ } else {
+skip:
+ lt_map_delete(o);
}
-skip:
return o;
}
STATIC OP *lt_ck_padsv(pTHX_ OP *o) {
lt_pp_padsv_restore(o);
+ lt_map_delete(o);
+
return CALL_FPTR(lt_old_ck_padsv)(aTHX_ o);
}
-/* This file is part of the Lexical-Types Perl module.
+/* This file is part of the Lexical::Types Perl module.
* See http://search.cpan.org/dist/Lexical-Types/ */
/* This is a pointer table implementation essentially copied from the ptr_table
void *oldval = ent->val;
PTABLE_VAL_FREE(oldval);
ent->val = val;
- } else {
+ } else if (val) {
const UV i = PTABLE_HASH(key) & t->max;
ent = PerlMemShared_malloc(sizeof *ent);
ent->key = key;