- (void) hv_store(MY_CXT.map, k->name, k->len, key, 0);
+ (void) hv_store(MY_CXT.map, c->name, c->namelen, newSViv(PTR2IV(c)), 0);
+ }
+}
+
+sub_op_config_t *sub_op_dup(pTHX_ const sub_op_config_t *orig) {
+ STRLEN len;
+ sub_op_config_t *dupe = PerlMemShared_malloc(sizeof *dupe);
+
+ len = orig->namelen;
+ if (orig->name) {
+ dupe->name = PerlMemShared_malloc(len + 1);
+ Copy(orig->name, dupe->name, len, char);
+ ((char *) dupe->name)[len] = '\0';
+ } else {
+ dupe->name = NULL;