@@ -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))
@@ -571,7 +571,7 @@ static void *zend_mm_mmap(size_t size)
571571/* number of trailing set (1) bits */
572572ZEND_ATTRIBUTE_CONST static zend_always_inline int zend_mm_bitset_nts (zend_mm_bitset bitset )
573573{
574- #if (defined(__GNUC__ ) || __has_builtin (__builtin_ctzl )) && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL )
574+ #if (defined(__GNUC__ ) || __has_builtin (__builtin_ctzl )) && SIZEOF_SIZE_T == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL )
575575 return __builtin_ctzl (~bitset );
576576#elif (defined(__GNUC__ ) || __has_builtin (__builtin_ctzll )) && defined(PHP_HAVE_BUILTIN_CTZLL )
577577 return __builtin_ctzll (~bitset );
@@ -594,7 +594,7 @@ ZEND_ATTRIBUTE_CONST static zend_always_inline int zend_mm_bitset_nts(zend_mm_bi
594594 if (bitset == (zend_mm_bitset )- 1 ) return ZEND_MM_BITSET_LEN ;
595595
596596 n = 0 ;
597- #if SIZEOF_ZEND_LONG == 8
597+ #if SIZEOF_SIZE_T == 8
598598 if (sizeof (zend_mm_bitset ) == 8 ) {
599599 if ((bitset & 0xffffffff ) == 0xffffffff ) {n += 32 ; bitset = bitset >> Z_UL (32 );}
600600 }
@@ -2082,7 +2082,7 @@ static zend_mm_heap *zend_mm_init(void)
20822082#endif
20832083 zend_mm_init_key (heap );
20842084#if ZEND_MM_LIMIT
2085- heap -> limit = (size_t )Z_L ( -1 ) >> 1 ;
2085+ heap -> limit = (size_t )-1 >> 1 ;
20862086 heap -> overflow = 0 ;
20872087#endif
20882088#if ZEND_MM_CUSTOM
@@ -3285,7 +3285,7 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
32853285 zend_mm_heap * mm_heap = alloc_globals -> mm_heap = malloc (sizeof (zend_mm_heap ));
32863286 memset (mm_heap , 0 , sizeof (zend_mm_heap ));
32873287 mm_heap -> use_custom_heap = ZEND_MM_CUSTOM_HEAP_STD ;
3288- mm_heap -> limit = (size_t )Z_L ( -1 ) >> 1 ;
3288+ mm_heap -> limit = (size_t )-1 >> 1 ;
32893289 mm_heap -> overflow = 0 ;
32903290
32913291 if (!tracked ) {
@@ -3506,7 +3506,7 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_handlers *handlers, void
35063506#endif
35073507 zend_mm_init_key (heap );
35083508#if ZEND_MM_LIMIT
3509- heap -> limit = (size_t )Z_L ( -1 ) >> 1 ;
3509+ heap -> limit = (size_t )-1 >> 1 ;
35103510 heap -> overflow = 0 ;
35113511#endif
35123512#if ZEND_MM_CUSTOM
0 commit comments