check_ph(cophh_fetch_pvs(a, "foo_\xc2\x8c", 0));
check_iv(cophh_fetch_pvs(a, "foo_\xd9\xa6", COPHH_KEY_UTF8), 666);
check_ph(cophh_fetch_pvs(a, "foo_\xd9\xa6", 0));
- cophh_free(a);
+ ENTER;
+ SAVEFREECOPHH(a);
+ LEAVE;
#undef check_ph
#undef check_iv
#undef msvpvs
ptr = SSPOPPTR;
SvREFCNT_dec(MUTABLE_SV(ptr));
break;
+ case SAVEt_FREECOPHH:
+ ptr = SSPOPPTR;
+ cophh_free((COPHH *)ptr);
+ break;
case SAVEt_MORTALIZESV:
ptr = SSPOPPTR;
sv_2mortal(MUTABLE_SV(ptr));
#define SAVEt_I32_SMALL 47
#define SAVEt_INT_SMALL 48
#define SAVEt_GVSV 49
+#define SAVEt_FREECOPHH 50
#define SAVEf_SETMAGIC 1
#define SAVEf_KEEPOLDELEM 2
#define SAVEGENERICPV(s) save_generic_pvref((char**)&(s))
#define SAVESHAREDPV(s) save_shared_pvref((char**)&(s))
#define SAVESETSVFLAGS(sv,mask,val) save_set_svflags(sv,mask,val)
+#define SAVEFREECOPHH(h) save_pushptr((void *)(h), SAVEt_FREECOPHH)
#define SAVEDELETE(h,k,l) \
save_delete(MUTABLE_HV(h), (char*)(k), (I32)(l))
#define SAVEHDELETE(h,s) \
else
TOPPTR(nss,ix) = NULL;
break;
+ case SAVEt_FREECOPHH:
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = cophh_copy((COPHH *)ptr);
+ break;
case SAVEt_DELETE:
hv = (const HV *)POPPTR(ss,ix);
TOPPTR(nss,ix) = hv_dup_inc(hv, param);