Fix invocation of GC for non-zero generations.

This commit is contained in:
Ruben Ayrapetyan
2014-08-07 21:10:36 +04:00
parent d7e28e3a28
commit 7ad6c25bb2
2 changed files with 12 additions and 18 deletions
+12 -8
View File
@@ -65,16 +65,20 @@ ecma_alloc_ ## ecma_type (void) \
return p ## ecma_type; \
} \
\
ecma_gc_run( ECMA_GC_GEN_0 ); \
\
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 ) ) \
for ( ecma_gc_gen_t gen_id = ECMA_GC_GEN_0; \
gen_id < ECMA_GC_GEN_COUNT; \
gen_id++ ) \
{ \
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(); \
}