/* ... Thread safety and multiplicity ...................................... */
+/* Safe unless stated otherwise in Makefile.PL */
+#ifndef REP_FORKSAFE
+# define REP_FORKSAFE 1
+#endif
+
#ifndef REP_MULTIPLICITY
# if defined(MULTIPLICITY) || defined(PERL_IMPLICIT_CONTEXT)
# define REP_MULTIPLICITY 1
STATIC SV *rep_tag(pTHX_ SV *comp, SV *exec) {
#define rep_tag(C, E) rep_tag(aTHX_ (C), (E))
rep_hint_t *h;
- dMY_CXT;
h = PerlMemShared_malloc(sizeof *h);
h->comp = rep_validate_callback(comp);
void
Plugin_free(pTHX_ REGEXP * const RX)
{
- struct regexp *rx = rxREGEXP(RX);
- GET_SELF_FROM_PPRIVATE(rx->pprivate);
+ struct regexp *rx;
+ re__engine__Plugin self;
+
+ if (PL_dirty)
+ return;
+
+ rx = rxREGEXP(RX);
+ SELF_FROM_PPRIVATE(self, rx->pprivate);
SvREFCNT_dec(self->pattern);
SvREFCNT_dec(self->str);
BOOT:
{
if (!rep_booted++) {
+ HV *stash;
+
PERL_HASH(rep_hash, __PACKAGE__, __PACKAGE_LEN__);
+
+ stash = gv_stashpvn(__PACKAGE__, __PACKAGE_LEN__, 1);
+ newCONSTSUB(stash, "REP_THREADSAFE", newSVuv(REP_THREADSAFE));
+ newCONSTSUB(stash, "REP_FORKSAFE", newSVuv(REP_FORKSAFE));
}
rep_setup();