Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58425 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3899 invoked from network); 1 Mar 2012 21:35:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Mar 2012 21:35:35 -0000 Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain l-i-e.com designates 67.139.134.202 as permitted sender) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:4794] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/D2-19316-5ABEF4F4 for ; Thu, 01 Mar 2012 16:35:34 -0500 Received: (qmail 16681 invoked by uid 98); 1 Mar 2012 21:35:35 -0000 Received: from localhost by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-2.05 ( Clear:RC:1(127.0.0.1):. Processed in 0.037979 secs); 01 Mar 2012 21:35:35 -0000 Received: from localhost (HELO www.l-i-e.com) (127.0.0.1) by localhost with SMTP; 1 Mar 2012 21:35:34 -0000 Received: from webmail (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Thu, 1 Mar 2012 15:35:34 -0600 Message-ID: <63ed698a0b5dbea1b4f6c9ca68fe926e.squirrel@www.l-i-e.com> In-Reply-To: <1330618943.51670.YahooMailNeo@web43505.mail.sp1.yahoo.com> References: <1330618943.51670.YahooMailNeo@web43505.mail.sp1.yahoo.com> Date: Thu, 1 Mar 2012 15:35:34 -0600 To: "PHP Developers Mailing List" User-Agent: SquirrelMail/1.4.21 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] question about Zend MM From: ceo@l-i-e.com ("Richard Lynch") WILD GUESS ALERT! I'm guessing that this is for byte-alignment on big-endian versus little-endian... So it's more like 11110000 and 00001111 as masks to flip-flop bytes by some binary logic / magic. The -1 is to "wrap" the byte to binary inversion. You might want to grep the code and see how they are actually used. That helps me a lot when I'm totally lost what the Magic Numbers are used for. Not knowing what the initial value of ZEND_MM_ALIGNMENT is in the first place, this is just wild guess... On Thu, March 1, 2012 10:22 am, Adi Mutu wrote: > > > 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, -- brain cancer update: http://richardlynch.blogspot.com/search/label/brain%20tumor Donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FS9NLTNEEKWBE