Skip to content

Commit

Permalink
[PMC] Fixed Coroutine PMC's mark vtable entry to avoid unnecessary wo…
Browse files Browse the repository at this point in the history
…rk (such

as marking its context twice, once here and once in Sub's mark).

git-svn-id: https://svn.parrot.org/parrot/trunk@39340 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
chromatic committed Jun 2, 2009
1 parent 77f2ae7 commit a899c48
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/pmc/coroutine.pmc
Expand Up @@ -76,9 +76,11 @@ Clone the coroutine.

VTABLE void init() {
Parrot_Coroutine_attributes *attrs =
mem_allocate_zeroed_typed(Parrot_Coroutine_attributes);
attrs->sub = (Parrot_sub*)new_coroutine(INTERP);
mem_allocate_typed(Parrot_Coroutine_attributes);

attrs->sub = (Parrot_sub *)new_coroutine(INTERP);
PMC_data(SELF) = attrs;

PObj_custom_mark_destroy_SETALL(SELF);
}

Expand Down Expand Up @@ -252,17 +254,15 @@ Marks the coroutine as live.

VTABLE void mark() {
Parrot_Coroutine_attributes *attrs = PARROT_COROUTINE(SELF);
Parrot_coro * const co = (Parrot_coro *)attrs->sub;
Parrot_coro * const co = (Parrot_coro *)attrs->sub;

/* co->ctx marked in SUPER(), so do not mark here */
if (co) {
if (co->ctx)
mark_context(INTERP, co->ctx);
if (co->dynamic_state)
mark_stack(INTERP, co->dynamic_state);

SUPER();
}

SUPER();
}
}

Expand Down

0 comments on commit a899c48

Please sign in to comment.