ptable_store(ud->wizards, ent->key, w);
}
+STATIC void vmg_thread_cleanup(pTHX_ void *);
+
+STATIC void vmg_thread_cleanup(pTHX_ void *ud) {
+ int *level = ud;
+
+ if (*level) {
+ --*level;
+ LEAVE;
+ SAVEDESTRUCTOR_X(vmg_thread_cleanup, level);
+ ENTER;
+ } else {
+ dMY_CXT;
+ PerlMemShared_free(level);
+ ptable_free(MY_CXT.wizards);
+ }
+}
#endif /* VMG_THREADSAFE */
/* --- Wizard objects ------------------------------------------------------ */
PROTOTYPE: DISABLE
PREINIT:
ptable *t;
- int *level;
U32 had_b__op_stash = 0;
opclass c;
PPCODE:
? gv_stashpv(vmg_opclassnames[c], 1) : NULL;
}
}
+ {
+ int *level;
+ level = PerlMemShared_malloc(sizeof *level);
+ *level = 1;
+ LEAVE;
+ SAVEDESTRUCTOR_X(vmg_thread_cleanup, level);
+ ENTER;
+ }
XSRETURN(0);
#endif /* VMG_THREADSAFE */