@@ -1341,13 +1341,7 @@ static zend_always_inline void zend_mm_set_next_free_slot(zend_mm_heap *heap, ui
1341
1341
ZEND_MM_FREE_SLOT_PTR_SHADOW (slot , bin_num ) = zend_mm_encode_free_slot (heap , next );
1342
1342
}
1343
1343
1344
- static zend_always_inline void zend_mm_copy_next_free_slot (zend_mm_free_slot * dest , uint32_t bin_num , zend_mm_free_slot * from )
1345
- {
1346
- dest -> next_free_slot = from -> next_free_slot ;
1347
- ZEND_MM_FREE_SLOT_PTR_SHADOW (dest , bin_num ) = ZEND_MM_FREE_SLOT_PTR_SHADOW (from , bin_num );
1348
- }
1349
-
1350
- static zend_always_inline zend_mm_free_slot * zend_mm_check_next_free_slot (zend_mm_heap * heap , uint32_t bin_num , zend_mm_free_slot * slot )
1344
+ static zend_always_inline zend_mm_free_slot * zend_mm_get_next_free_slot (zend_mm_heap * heap , uint32_t bin_num , zend_mm_free_slot * slot )
1351
1345
{
1352
1346
zend_mm_free_slot * next = slot -> next_free_slot ;
1353
1347
if (EXPECTED (next != NULL )) {
@@ -1428,7 +1422,7 @@ static zend_always_inline void *zend_mm_alloc_small(zend_mm_heap *heap, int bin_
1428
1422
1429
1423
if (EXPECTED (heap -> free_slot [bin_num ] != NULL )) {
1430
1424
zend_mm_free_slot * p = heap -> free_slot [bin_num ];
1431
- heap -> free_slot [bin_num ] = zend_mm_check_next_free_slot (heap , bin_num , p );
1425
+ heap -> free_slot [bin_num ] = zend_mm_get_next_free_slot (heap , bin_num , p );
1432
1426
return p ;
1433
1427
} else {
1434
1428
return zend_mm_alloc_small_slow (heap , bin_num ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC );
@@ -2135,7 +2129,7 @@ ZEND_API size_t zend_mm_gc(zend_mm_heap *heap)
2135
2129
has_free_pages = true;
2136
2130
}
2137
2131
chunk -> map [page_num ] = ZEND_MM_SRUN_EX (i , free_counter );
2138
- p = zend_mm_check_next_free_slot (heap , i , p );
2132
+ p = zend_mm_get_next_free_slot (heap , i , p );
2139
2133
}
2140
2134
2141
2135
if (!has_free_pages ) {
@@ -2161,18 +2155,18 @@ ZEND_API size_t zend_mm_gc(zend_mm_heap *heap)
2161
2155
ZEND_ASSERT (ZEND_MM_SRUN_BIN_NUM (info ) == i );
2162
2156
if (ZEND_MM_SRUN_FREE_COUNTER (info ) == bin_elements [i ]) {
2163
2157
/* remove from cache */
2158
+ p = zend_mm_get_next_free_slot (heap , i , p );
2164
2159
if (q == (zend_mm_free_slot * )& heap -> free_slot [i ]) {
2165
- q -> next_free_slot = zend_mm_check_next_free_slot ( heap , i , p ) ;
2160
+ q -> next_free_slot = p ;
2166
2161
} else {
2167
- zend_mm_copy_next_free_slot (( zend_mm_free_slot * ) q , i , p );
2162
+ zend_mm_set_next_free_slot ( heap , i , q , p );
2168
2163
}
2169
- p = zend_mm_check_next_free_slot (heap , i , p );
2170
2164
} else {
2171
2165
q = p ;
2172
2166
if (q == (zend_mm_free_slot * )& heap -> free_slot [i ]) {
2173
2167
p = q -> next_free_slot ;
2174
2168
} else {
2175
- p = zend_mm_check_next_free_slot (heap , i , q );
2169
+ p = zend_mm_get_next_free_slot (heap , i , q );
2176
2170
}
2177
2171
}
2178
2172
}
0 commit comments