static SV*
mop_instance_create_instance(pTHX_ HV* const stash) {
+ assert(stash);
return sv_bless( newRV_noinc((SV*)newHV()), stash );
}
static bool
mop_instance_has_slot(pTHX_ SV* const instance, SV* const slot) {
+ assert(instance);
+ assert(slot);
CHECK_INSTANCE(instance);
return hv_exists_ent((HV*)SvRV(instance), slot, 0U);
}
static SV*
mop_instance_get_slot(pTHX_ SV* const instance, SV* const slot) {
HE* he;
+ assert(instance);
+ assert(slot);
CHECK_INSTANCE(instance);
he = hv_fetch_ent((HV*)SvRV(instance), slot, FALSE, 0U);
return he ? HeVAL(he) : NULL;
mop_instance_set_slot(pTHX_ SV* const instance, SV* const slot, SV* const value) {
HE* he;
SV* sv;
+ assert(instance);
+ assert(slot);
+ assert(value);
CHECK_INSTANCE(instance);
he = hv_fetch_ent((HV*)SvRV(instance), slot, TRUE, 0U);
sv = HeVAL(he);
static SV*
mop_instance_delete_slot(pTHX_ SV* const instance, SV* const slot) {
+ assert(instance);
+ assert(slot);
CHECK_INSTANCE(instance);
return hv_delete_ent((HV*)SvRV(instance), slot, 0, 0U);
}
static void
mop_instance_weaken_slot(pTHX_ SV* const instance, SV* const slot) {
HE* he;
+ assert(instance);
+ assert(slot);
CHECK_INSTANCE(instance);
he = hv_fetch_ent((HV*)SvRV(instance), slot, FALSE, 0U);
if(he){