question about Zend MM
| From: | Adi Mutu | Date: | Thu, 01 Mar 2012 16:22:23 +0000 |
| Subject: | question about Zend MM | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-58416@lists.php.net to get a copy of this message | ||
Hello,
I want to understand how Zend MM works, so i'm looking trought the sources and i see this:
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1) #define ZEND_MM_ALIGNED_SIZE(size) (((size) +
ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
I understand that the first define will create something like 11111000 ( it will clear last 3 bits)
but what does the 2nd define? Before clearing the last 3 bytes why does it add ZEND_MM_ALIGNMENT- 1
to size?
Thanks,