Skip to content

Commit c994d90

Browse files
committed
Reorder conditions and set expectation.
1 parent bfaf662 commit c994d90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_objects_API.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_put(zend_object *object)
131131
/* When in shutdown sequesnce - do not reuse previously freed handles, to make sure
132132
* the dtors for newly created objects are called in zend_objects_store_call_destructors() loop
133133
*/
134-
if (!(EG(flags) & EG_FLAGS_IN_SHUTDOWN) && EG(objects_store).free_list_head != -1) {
134+
if (EG(objects_store).free_list_head != -1 && EXPECTED(!(EG(flags) & EG_FLAGS_IN_SHUTDOWN))) {
135135
handle = EG(objects_store).free_list_head;
136136
EG(objects_store).free_list_head = GET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[handle]);
137137
} else {
138-
if (EG(objects_store).top == EG(objects_store).size) {
138+
if (UNEXPECTED(EG(objects_store).top == EG(objects_store).size)) {
139139
uint32_t new_size = 2 * EG(objects_store).size;
140140
EG(objects_store).object_buckets = (zend_object **) erealloc(EG(objects_store).object_buckets, new_size * sizeof(zend_object*));
141141
/* Assign size after realloc, in case it fails */

0 commit comments

Comments
 (0)