File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -2185,7 +2185,7 @@ ZEND_API int zend_gc_collect_cycles(void)
2185
2185
gc_stack * stack = NULL ;
2186
2186
2187
2187
if (in_fiber ) {
2188
- context = emalloc ( sizeof (gc_async_context_t ));
2188
+ context = ecalloc ( 1 , sizeof (gc_async_context_t ));
2189
2189
stack = emalloc (sizeof (gc_stack ));
2190
2190
} else {
2191
2191
context = & GC_G (async_context );
@@ -2462,13 +2462,15 @@ ZEND_API int zend_gc_collect_cycles(void)
2462
2462
GC_G (collector_time ) += zend_hrtime () - GC_COLLECT_START_TIME ;
2463
2463
#ifdef PHP_ASYNC_API
2464
2464
if (in_fiber ) {
2465
+ const int total_count = GC_COLLECT_TOTAL_COUNT ;
2465
2466
efree (context );
2466
- gc_stack_free (stack );
2467
2467
efree (stack );
2468
+ return total_count ;
2468
2469
} else {
2469
2470
GC_G (async_context ).state = GC_ASYNC_STATE_NONE ;
2470
2471
if (GC_G (gc_stack ) != NULL ) {
2471
- GC_COLLECT_FREE_STACK ;
2472
+ GC_G (gc_stack ) = NULL ;
2473
+ efree (stack );
2472
2474
}
2473
2475
}
2474
2476
#endif
You can’t perform that action at this time.
0 commit comments