/* Our blessed object */
obj = newSV(0);
- Newxz(re, 1, struct replug);
+ Newx(re, 1, struct replug);
sv_setref_pv(obj, XSH_PACKAGE, (void *) re);
newREGEXP(RX);
re->pattern = (SV *) pattern;
SvREFCNT_inc_simple_void(re->pattern);
- /* If there's an exec callback, store it into the private object so that it
- * will be the one to be called, even if the engine changes in between */
- if (h->exec) {
- re->cb_exec = h->exec;
- SvREFCNT_inc_simple_void_NN(h->exec);
- }
+ re->str = NULL;
+ re->stash = NULL;
- /* Same goes for the free callback, if there's one. */
- if (h->free) {
- re->cb_free = h->free;
- SvREFCNT_inc_simple_void_NN(h->free);
- }
+ /* Store the default exec callback (which may be NULL) into the regexp
+ * object. */
+ re->cb_exec = h->exec;
+ SvREFCNT_inc_simple_void(h->exec);
+
+ /* Same goes for the free callback. */
+ re->cb_free = h->free;
+ SvREFCNT_inc_simple_void(h->free);
re->cb_num_capture_buff_FETCH = NULL;
re->cb_num_capture_buff_STORE = NULL;