mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Reorder conditions and set expectation.
This commit is contained in:
parent
bfaf662ac2
commit
c994d90db2
1 changed files with 2 additions and 2 deletions
|
@ -131,11 +131,11 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_put(zend_object *object)
|
||||||
/* When in shutdown sequesnce - do not reuse previously freed handles, to make sure
|
/* When in shutdown sequesnce - do not reuse previously freed handles, to make sure
|
||||||
* the dtors for newly created objects are called in zend_objects_store_call_destructors() loop
|
* the dtors for newly created objects are called in zend_objects_store_call_destructors() loop
|
||||||
*/
|
*/
|
||||||
if (!(EG(flags) & EG_FLAGS_IN_SHUTDOWN) && EG(objects_store).free_list_head != -1) {
|
if (EG(objects_store).free_list_head != -1 && EXPECTED(!(EG(flags) & EG_FLAGS_IN_SHUTDOWN))) {
|
||||||
handle = EG(objects_store).free_list_head;
|
handle = EG(objects_store).free_list_head;
|
||||||
EG(objects_store).free_list_head = GET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[handle]);
|
EG(objects_store).free_list_head = GET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[handle]);
|
||||||
} else {
|
} else {
|
||||||
if (EG(objects_store).top == EG(objects_store).size) {
|
if (UNEXPECTED(EG(objects_store).top == EG(objects_store).size)) {
|
||||||
uint32_t new_size = 2 * EG(objects_store).size;
|
uint32_t new_size = 2 * EG(objects_store).size;
|
||||||
EG(objects_store).object_buckets = (zend_object **) erealloc(EG(objects_store).object_buckets, new_size * sizeof(zend_object*));
|
EG(objects_store).object_buckets = (zend_object **) erealloc(EG(objects_store).object_buckets, new_size * sizeof(zend_object*));
|
||||||
/* Assign size after realloc, in case it fails */
|
/* Assign size after realloc, in case it fails */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue