Skip to content

Commit 20c6b14

Browse files
committed
Revert "Zend/zend_fibers: change return value to zend_result"
This reverts commit 371ae12.
1 parent fb5e77b commit 20c6b14

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

UPGRADING.INTERNALS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ PHP 8.3 INTERNALS UPGRADE NOTES
3434
the class table. zend_register_class_alias_ex() will not increase
3535
the refcount for class aliases and the cleanup function takes this
3636
into account.
37-
* The return types of the following functions have been changed from
38-
`bool` to `zend_result`:
39-
- zend_fiber_init_context()
4037
* The fast_add_function() has been removed, use add_function() that will
4138
call the static inline add_function_fast() instead.
4239
* The order of members of zend_op_array, zend_ssa_var, zend_ssa_var_info,

Zend/zend_fibers.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,12 @@ ZEND_API bool zend_fiber_switch_blocked(void)
394394
return zend_fiber_switch_blocking;
395395
}
396396

397-
ZEND_API zend_result zend_fiber_init_context(zend_fiber_context *context, void *kind, zend_fiber_coroutine coroutine, size_t stack_size)
397+
ZEND_API bool zend_fiber_init_context(zend_fiber_context *context, void *kind, zend_fiber_coroutine coroutine, size_t stack_size)
398398
{
399399
context->stack = zend_fiber_stack_allocate(stack_size);
400400

401401
if (UNEXPECTED(!context->stack)) {
402-
return FAILURE;
402+
return false;
403403
}
404404

405405
#ifdef ZEND_FIBER_UCONTEXT
@@ -438,7 +438,7 @@ ZEND_API zend_result zend_fiber_init_context(zend_fiber_context *context, void *
438438

439439
zend_observer_fiber_init_notify(context);
440440

441-
return SUCCESS;
441+
return true;
442442
}
443443

444444
ZEND_API void zend_fiber_destroy_context(zend_fiber_context *context)
@@ -812,7 +812,7 @@ ZEND_METHOD(Fiber, start)
812812
RETURN_THROWS();
813813
}
814814

815-
if (zend_fiber_init_context(&fiber->context, zend_ce_fiber, zend_fiber_execute, EG(fiber_stack_size)) == FAILURE) {
815+
if (!zend_fiber_init_context(&fiber->context, zend_ce_fiber, zend_fiber_execute, EG(fiber_stack_size))) {
816816
RETURN_THROWS();
817817
}
818818

Zend/zend_fibers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ struct _zend_fiber {
133133
};
134134

135135
/* These functions may be used to create custom fiber objects using the bundled fiber switching context. */
136-
ZEND_API zend_result zend_fiber_init_context(zend_fiber_context *context, void *kind, zend_fiber_coroutine coroutine, size_t stack_size);
136+
ZEND_API bool zend_fiber_init_context(zend_fiber_context *context, void *kind, zend_fiber_coroutine coroutine, size_t stack_size);
137137
ZEND_API void zend_fiber_destroy_context(zend_fiber_context *context);
138138
ZEND_API void zend_fiber_switch_context(zend_fiber_transfer *transfer);
139139
#ifdef ZEND_CHECK_STACK_LIMIT

0 commit comments

Comments
 (0)