SAVEDESTRUCTOR_X(restore_magic, (void*)mgs_ix);
SAVEDESTRUCTOR_X(restore_magic, (void*)(intptr_t)mgs_ix);
S_save_magic(pTHX_ I32 mgs_ix, SV *sv){    MGS* mgs;    assert(SvMAGICAL(sv));    SAVEDESTRUCTOR_X(restore_magic, (void*)mgs_ix);    mgs = SSPTR(mgs_ix, MGS*);    mgs->mgs_sv = sv;    mgs->mgs_flags = SvMAGICAL(sv) | SvREADONLY(sv);    mgs->mgs_ss_ix = PL_savestack_ix;   /* points after the saved destructor */    SvMAGICAL_off(sv);    SvREADONLY_off(sv);    SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;}