File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -461,11 +461,14 @@ ZEND_API void zend_fiber_destroy_context(zend_fiber_context *context)
461
461
{
462
462
zend_observer_fiber_destroy_notify (context );
463
463
464
+ // This code allows freeing the memory of the context independently of the stack memory.
465
+ zend_fiber_stack * stack = context -> stack ;
466
+
464
467
if (context -> cleanup ) {
465
468
context -> cleanup (context );
466
469
}
467
470
468
- zend_fiber_stack_free (context -> stack );
471
+ zend_fiber_stack_free (stack );
469
472
}
470
473
471
474
ZEND_API void zend_fiber_switch_context (zend_fiber_transfer * transfer )
Original file line number Diff line number Diff line change @@ -2238,7 +2238,10 @@ ZEND_API int zend_gc_collect_cycles(void)
2238
2238
zend_refcounted * p ;
2239
2239
uint32_t gc_flags = 0 ;
2240
2240
uint32_t idx , end ;
2241
- #ifndef PHP_ASYNC_API
2241
+ #ifdef PHP_ASYNC_API
2242
+ stack -> next = NULL ;
2243
+ stack -> prev = NULL ;
2244
+ #else
2242
2245
int count ;
2243
2246
gc_stack stack ;
2244
2247
stack .prev = NULL ;
@@ -2351,7 +2354,7 @@ ZEND_API int zend_gc_collect_cycles(void)
2351
2354
}
2352
2355
}
2353
2356
2354
- GC_COLLECT_FREE_STACK ;
2357
+ gc_stack_free ( GC_COLLECT_STACK ) ;
2355
2358
2356
2359
#ifdef PHP_ASYNC_API
2357
2360
end = GC_G (first_unused );
You can’t perform that action at this time.
0 commit comments