/
retcontinuation.pmc
37 lines (32 loc) · 1.04 KB
/
retcontinuation.pmc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* RetContinuation.pmc
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
* $Id$
* 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);
}
PMC* clone() {
struct Parrot_Sub * sub;
PMC* ret = pmc_new_noinit(INTERP, SELF->vtable->base_type);
sub = PMC_sub(ret) = mem_sys_allocate(sizeof(struct Parrot_Sub));
memcpy(sub, PMC_sub(SELF), sizeof(struct Parrot_Sub));
ret->cache.struct_val = SELF->cache.struct_val;
PObj_custom_mark_destroy_SETALL(ret);
return ret;
}
}