|
49 | 49 | #include <sys/syscall.h> |
50 | 50 | #endif |
51 | 51 |
|
| 52 | +#include "zend_async_API.h" |
| 53 | + |
52 | 54 | ZEND_API void (*zend_execute_ex)(zend_execute_data *execute_data); |
53 | 55 | ZEND_API void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value); |
54 | 56 | ZEND_API zend_class_entry *(*zend_autoload)(zend_string *name, zend_string *lc_name); |
@@ -199,14 +201,12 @@ void init_executor(void) /* {{{ */ |
199 | 201 | EG(filename_override) = NULL; |
200 | 202 | EG(lineno_override) = -1; |
201 | 203 |
|
202 | | -#ifdef PHP_ASYNC_API |
203 | 204 | EG(shutdown_context) = (zend_shutdown_context_t) { |
204 | 205 | .is_started = false, |
205 | 206 | .coroutine = NULL, |
206 | 207 | .num_elements = 0, |
207 | 208 | .idx = 0 |
208 | 209 | }; |
209 | | -#endif |
210 | 210 |
|
211 | 211 | zend_max_execution_timer_init(); |
212 | 212 | zend_fiber_init(); |
@@ -257,29 +257,7 @@ static ZEND_COLD void zend_throw_or_error(int fetch_type, zend_class_entry *exce |
257 | 257 | } |
258 | 258 | /* }}} */ |
259 | 259 |
|
260 | | -void shutdown_destructors(void) /* {{{ */ |
261 | | -{ |
262 | | - if (CG(unclean_shutdown)) { |
263 | | - EG(symbol_table).pDestructor = zend_unclean_zval_ptr_dtor; |
264 | | - } |
265 | | - zend_try { |
266 | | - uint32_t symbols; |
267 | | - do { |
268 | | - symbols = zend_hash_num_elements(&EG(symbol_table)); |
269 | | - zend_hash_reverse_apply(&EG(symbol_table), (apply_func_t) zval_call_destructor); |
270 | | - } while (symbols != zend_hash_num_elements(&EG(symbol_table))); |
271 | | - zend_objects_store_call_destructors(&EG(objects_store)); |
272 | | - } zend_catch { |
273 | | - /* if we couldn't destruct cleanly, mark all objects as destructed anyway */ |
274 | | - zend_objects_store_mark_destructed(&EG(objects_store)); |
275 | | - } zend_end_try(); |
276 | | -} |
277 | | -/* }}} */ |
278 | | - |
279 | | -#ifdef PHP_ASYNC_API |
280 | | -#include "zend_async_API.h" |
281 | | - |
282 | | -static void shutdown_destructors_coroutine_dtor(zend_coroutine_t *coroutine) |
| 260 | +static void shutdown_destructors_coroutine_dtor(zend_coroutine_t *coroutine) /* {{{ */ |
283 | 261 | { |
284 | 262 | zend_shutdown_context_t *shutdown_context = &EG(shutdown_context); |
285 | 263 |
|
@@ -318,7 +296,7 @@ static bool shutdown_destructors_context_switch_handler( |
318 | 296 | return false; |
319 | 297 | } |
320 | 298 |
|
321 | | -void shutdown_destructors_async(void) /* {{{ */ |
| 299 | +void shutdown_destructors(void) /* {{{ */ |
322 | 300 | { |
323 | 301 | zend_coroutine_t *coroutine = ZEND_ASYNC_CURRENT_COROUTINE; |
324 | 302 | bool should_continue = false; |
@@ -400,7 +378,6 @@ void shutdown_destructors_async(void) /* {{{ */ |
400 | 378 | shutdown_context->is_started = false; |
401 | 379 | } |
402 | 380 | /* }}} */ |
403 | | -#endif |
404 | 381 |
|
405 | 382 | /* Free values held by the executor. */ |
406 | 383 | ZEND_API void zend_shutdown_executor_values(bool fast_shutdown) |
|
0 commit comments