Hi!


#define ZEND_MM_SMALL_FREE_BUCKET(heap, index) \
(zend_mm_free_block*) ((char*)&heap->free_buckets[index * 2] + \
sizeof(zend_mm_free_block*) * 2 - \
sizeof(zend_mm_small_free_block))
#define
ZEND_MM_REST_BUCKET(heap) \
(zend_mm_free_block*)((char*)&heap->rest_buckets[0] + \
sizeof(zend_mm_free_block*) * 2 - \
sizeof(zend_mm_small_free_block))

IIRC the purpose of these defines is that the MM caches small free blocks so that it could find them faster, so that for example allocating zvals (frequent case) goes faster. So it has a small cache for such blocks, by size, so the allocator can for example quickly find a free block of size of zval or of size of Hashtable. These macros try to find such free block for given small size (first one) or for the rest of blocks (i.e. bigger blocks which share one free list).
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to