|
@ -1006,12 +1006,12 @@ void ink_gc(struct context* ctx) { |
|
|
|
|
|
|
|
|
/* Start by marking the roots of the routines, Clear the routines if possible */ |
|
|
/* Start by marking the roots of the routines, Clear the routines if possible */ |
|
|
for(i = 0; i < ctx->routines_top; ++i) { |
|
|
for(i = 0; i < ctx->routines_top; ++i) { |
|
|
if(ctx->routine[i].panic == INK_ROUTINE_SUCCESS) { |
|
|
|
|
|
ctx->free(ctx->routine[i].stack); |
|
|
|
|
|
ctx->free(ctx->routine[i].function_stack); |
|
|
|
|
|
ctx->routine[i].panic = INK_ROUTINE_CAN_REUSE; |
|
|
|
|
|
|
|
|
if(ctx->routines[i].panic == INK_ROUTINE_SUCCESS) { |
|
|
|
|
|
ctx->free(ctx->routines[i].stack); |
|
|
|
|
|
ctx->free(ctx->routines[i].function_stack); |
|
|
|
|
|
ctx->routines[i].panic = INK_ROUTINE_CAN_REUSE; |
|
|
} |
|
|
} |
|
|
if(ctx->routine[i].panic == INK_ROUTINE_CAN_REUSE) { |
|
|
|
|
|
|
|
|
if(ctx->routines[i].panic == INK_ROUTINE_CAN_REUSE) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
for(j = 0; j < ctx->routines[i].top; ++j) { |
|
|
for(j = 0; j < ctx->routines[i].top; ++j) { |
|
|