/* RetContinuation.pmc
 *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
 *  CVS Info
 *     $Id: retcontinuation.pmc,v 1.4 2003/08/28 08:11:05 leo Exp $
 *  Overview:
 *     These are the vtable functions for the RetContinuation base class.
 *  Data Structure and Algorithms:
 *  History:
 *     Initial revision by sean 2002/08/04
 *  Notes:
 *     A return continuation doesn't make COWed copies of the context,
 *     it just has pointers to thecontext, that are restored on invoke.
 *  References:
 */

#include "parrot/parrot.h"
#include "parrot/method_util.h"

pmclass RetContinuation extends Continuation {

    void init () {
	PMC_sub(SELF) = new_ret_continuation(INTERP);
	SELF->cache.struct_val = NULL;
	PObj_custom_mark_destroy_SETALL(SELF);
    }

    void clone(PMC *ret) {
	struct Parrot_Sub * sub;
	sub = PMC_sub(ret) = mem_sys_allocate(sizeof(struct Parrot_Sub));
	memcpy(sub, PMC_sub(SELF), sizeof(struct Parrot_Sub));
	PObj_custom_mark_destroy_SETALL(ret);
    }
}

