Fix invocation of GC for non-zero generations.
This commit is contained in:
@@ -65,16 +65,20 @@ ecma_alloc_ ## ecma_type (void) \
|
|||||||
return p ## ecma_type; \
|
return p ## ecma_type; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
ecma_gc_run( ECMA_GC_GEN_0 ); \
|
for ( ecma_gc_gen_t gen_id = ECMA_GC_GEN_0; \
|
||||||
\
|
gen_id < ECMA_GC_GEN_COUNT; \
|
||||||
p ## ecma_type = (ecma_ ## ecma_type ## _t *) \
|
gen_id++ ) \
|
||||||
mem_pools_alloc( mem_size_to_pool_chunk_type( sizeof(ecma_ ## ecma_type ## _t))); \
|
|
||||||
\
|
|
||||||
if ( likely( p ## ecma_type != NULL ) ) \
|
|
||||||
{ \
|
{ \
|
||||||
return p ## ecma_type; \
|
ecma_gc_run( gen_id ); \
|
||||||
|
\
|
||||||
|
p ## ecma_type = (ecma_ ## ecma_type ## _t *) \
|
||||||
|
mem_pools_alloc( mem_size_to_pool_chunk_type( sizeof(ecma_ ## ecma_type ## _t))); \
|
||||||
|
\
|
||||||
|
if ( likely( p ## ecma_type != NULL ) ) \
|
||||||
|
{ \
|
||||||
|
return p ## ecma_type; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
\
|
|
||||||
JERRY_UNREACHABLE(); \
|
JERRY_UNREACHABLE(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -323,8 +323,6 @@ ecma_gc_run( ecma_gc_gen_t max_gen_to_collect) /**< maximum generation to run co
|
|||||||
{
|
{
|
||||||
JERRY_ASSERT( max_gen_to_collect < ECMA_GC_GEN_COUNT );
|
JERRY_ASSERT( max_gen_to_collect < ECMA_GC_GEN_COUNT );
|
||||||
|
|
||||||
bool was_something_sweeped = false;
|
|
||||||
|
|
||||||
/* clearing visited flags for all objects of generations to be processed */
|
/* clearing visited flags for all objects of generations to be processed */
|
||||||
for ( ecma_gc_gen_t gen_id = 0; gen_id <= max_gen_to_collect; gen_id++ )
|
for ( ecma_gc_gen_t gen_id = 0; gen_id <= max_gen_to_collect; gen_id++ )
|
||||||
{
|
{
|
||||||
@@ -386,8 +384,6 @@ ecma_gc_run( ecma_gc_gen_t max_gen_to_collect) /**< maximum generation to run co
|
|||||||
|
|
||||||
if ( !obj_iter_p->gc_info.visited )
|
if ( !obj_iter_p->gc_info.visited )
|
||||||
{
|
{
|
||||||
was_something_sweeped = true;
|
|
||||||
|
|
||||||
ecma_gc_sweep( obj_iter_p);
|
ecma_gc_sweep( obj_iter_p);
|
||||||
|
|
||||||
if ( likely( obj_prev_p != NULL ) )
|
if ( likely( obj_prev_p != NULL ) )
|
||||||
@@ -450,12 +446,6 @@ ecma_gc_run( ecma_gc_gen_t max_gen_to_collect) /**< maximum generation to run co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !JERRY_NDEBUG */
|
#endif /* !JERRY_NDEBUG */
|
||||||
|
|
||||||
if ( !was_something_sweeped
|
|
||||||
&& max_gen_to_collect != ECMA_GC_GEN_COUNT - 1 )
|
|
||||||
{
|
|
||||||
ecma_gc_run( max_gen_to_collect + 1);
|
|
||||||
}
|
|
||||||
} /* ecma_gc_run */
|
} /* ecma_gc_run */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user