Class-XSConstructor

 view release on metacpan or  search on metacpan

XSConstructor.xs  view on Meta::CPAN

}

void
clone(self, depth=-1)
    SV *self
    int depth
    PREINIT:
    SV *clone = &PL_sv_undef;
    HV *hseen = newHV();
    AV *weakrefs = newAV();
    PPCODE:
    TRACEME(("ref = 0x%x\n", self));
    clone = sv_clone( aTHX_ self, hseen, depth, 0, weakrefs );
    /* Now apply deferred weakening.
     * All strong references in the clone graph are established,
     * so it is safe to weaken references without destroying referents. */
    HANDLE_WEAKREFS( weakrefs );
    hv_clear(hseen);  /* Free HV */
    SvREFCNT_dec((SV *)hseen);
    EXTEND(SP,1);
    PUSHs(sv_2mortal(clone));



( run in 1.807 second using v1.01-cache-2.11-cpan-71847e10f99 )