@@ -174,7 +174,7 @@ static size_t _real_page_size = ZEND_MM_PAGE_SIZE;
174174#endif
175175
176176typedef uint32_t zend_mm_page_info ; /* 4-byte integer */
177- typedef zend_ulong zend_mm_bitset ; /* 4-byte or 8-byte integer */
177+ typedef size_t zend_mm_bitset ; /* 4-byte or 8-byte integer */
178178
179179#define ZEND_MM_ALIGNED_OFFSET (size , alignment ) \
180180 (((size_t)(size)) & ((alignment) - 1))
@@ -587,7 +587,7 @@ static void *zend_mm_mmap(size_t size)
587587/* number of trailing set (1) bits */
588588ZEND_ATTRIBUTE_CONST static zend_always_inline int zend_mm_bitset_nts (zend_mm_bitset bitset )
589589{
590- #if (defined(__GNUC__ ) || __has_builtin (__builtin_ctzl )) && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL )
590+ #if (defined(__GNUC__ ) || __has_builtin (__builtin_ctzl )) && SIZEOF_SIZE_T == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL )
591591 return __builtin_ctzl (~bitset );
592592#elif (defined(__GNUC__ ) || __has_builtin (__builtin_ctzll )) && defined(PHP_HAVE_BUILTIN_CTZLL )
593593 return __builtin_ctzll (~bitset );
@@ -610,7 +610,7 @@ ZEND_ATTRIBUTE_CONST static zend_always_inline int zend_mm_bitset_nts(zend_mm_bi
610610 if (bitset == (zend_mm_bitset )- 1 ) return ZEND_MM_BITSET_LEN ;
611611
612612 n = 0 ;
613- #if SIZEOF_ZEND_LONG == 8
613+ #if SIZEOF_SIZE_T == 8
614614 if (sizeof (zend_mm_bitset ) == 8 ) {
615615 if ((bitset & 0xffffffff ) == 0xffffffff ) {n += 32 ; bitset = bitset >> Z_UL (32 );}
616616 }
@@ -2065,7 +2065,7 @@ static zend_mm_heap *zend_mm_init(void)
20652065#endif
20662066 zend_mm_init_key (heap );
20672067#if ZEND_MM_LIMIT
2068- heap -> limit = (size_t )Z_L ( -1 ) >> 1 ;
2068+ heap -> limit = (size_t )-1 >> 1 ;
20692069 heap -> overflow = 0 ;
20702070#endif
20712071#if ZEND_MM_CUSTOM
@@ -3262,7 +3262,7 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
32623262 zend_mm_heap * mm_heap = alloc_globals -> mm_heap = malloc (sizeof (zend_mm_heap ));
32633263 memset (mm_heap , 0 , sizeof (zend_mm_heap ));
32643264 mm_heap -> use_custom_heap = ZEND_MM_CUSTOM_HEAP_STD ;
3265- mm_heap -> limit = (size_t )Z_L ( -1 ) >> 1 ;
3265+ mm_heap -> limit = (size_t )-1 >> 1 ;
32663266 mm_heap -> overflow = 0 ;
32673267
32683268 if (!tracked ) {
@@ -3483,7 +3483,7 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_handlers *handlers, void
34833483#endif
34843484 zend_mm_init_key (heap );
34853485#if ZEND_MM_LIMIT
3486- heap -> limit = (size_t )Z_L ( -1 ) >> 1 ;
3486+ heap -> limit = (size_t )-1 >> 1 ;
34873487 heap -> overflow = 0 ;
34883488#endif
34893489#if ZEND_MM_CUSTOM
0 commit comments