Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58493 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90210 invoked from network); 2 Mar 2012 14:41:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Mar 2012 14:41:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:56086] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/C0-20106-92CD05F4 for ; Fri, 02 Mar 2012 09:41:47 -0500 Received: by vcbfo14 with SMTP id fo14so1695109vcb.29 for ; Fri, 02 Mar 2012 06:41:43 -0800 (PST) Received-SPF: pass (google.com: domain of laruence@gmail.com designates 10.52.90.111 as permitted sender) client-ip=10.52.90.111; Authentication-Results: mr.google.com; spf=pass (google.com: domain of laruence@gmail.com designates 10.52.90.111 as permitted sender) smtp.mail=laruence@gmail.com; dkim=pass header.i=laruence@gmail.com Received: from mr.google.com ([10.52.90.111]) by 10.52.90.111 with SMTP id bv15mr16900899vdb.34.1330699303248 (num_hops = 1); Fri, 02 Mar 2012 06:41:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=AZ4P6wUpOPbO7vvD5tYySje277Zj+GblCENBq1XCTGo=; b=TAKtbkriug++tzdsfZZWXvgXTs59wXsPrsGhZ10md16PuH8NTTp6vD7DbmjFVMlwph OSUwIAHE5q7qTpavexj6qiihOhw9CBzFnPf73S1ejFOy2zYsOropgjDlNZfJKBQ6a20T ptvkIZrXBI5jJcOon0xcZWqOP6V91HiAeZ8fPB1aX2Q41UAvtLI/mjZpYyI1vYd9Q0kj hR45FRp9VFXsTkntFgcTZBDX+wDpp+aEKUohHaEC0P2vehL/uczpQ5MyCMNG9X9B3dd0 2WRgNAq5Vhrz6dnfU5W9qt7qx+4vyPDIGuxgFFsfk+ds/6w8emzmeIPbffKdSlaC2JrR TNlA== Received: by 10.52.90.111 with SMTP id bv15mr14336485vdb.34.1330699303196; Fri, 02 Mar 2012 06:41:43 -0800 (PST) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.220.178.130 with HTTP; Fri, 2 Mar 2012 06:41:23 -0800 (PST) In-Reply-To: <1330692703.90971.YahooMailNeo@web43509.mail.sp1.yahoo.com> References: <1330692703.90971.YahooMailNeo@web43509.mail.sp1.yahoo.com> Date: Fri, 2 Mar 2012 22:41:23 +0800 X-Google-Sender-Auth: BBAX6b2JvCIK991iy9Rfd55IIp4 Message-ID: To: Adi Mutu Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] ZEND_MM_SMALL_FREE_BUCKET and ZEND_MM_REST_BUCKET From: laruence@php.net (Laruence) On Fri, Mar 2, 2012 at 8:51 PM, Adi Mutu wrote: > > > Hello, > > Can somebody shed some light on these 2 defines? Thanks. > > > #define ZEND_MM_SMALL_FREE_BUCKET(heap, index) \ (zend_mm_free_block*) ((= char*)&heap->free_buckets[index * 2] + \ =C2=A0=C2=A0=C2=A0 sizeof(zend_mm_= free_block*) * 2 - \ =C2=A0=C2=A0=C2=A0=C2=A0 sizeof(zend_mm_small_free_blo= ck)) =C2=A0=C2=A0=C2=A0=C2=A0 #define ZEND_MM_REST_BUCKET(heap) \ =C2=A0=C2= =A0=C2=A0=C2=A0 (zend_mm_free_block*)((char*)&heap->rest_buckets[0] + \ =C2= =A0=C2=A0=C2=A0=C2=A0 sizeof(zend_mm_free_block*) * 2 - \ =C2=A0=C2=A0=C2= =A0=C2=A0 sizeof(zend_mm_small_free_block)) Hi: the first MACRO is a tricky way to put a number of ZEND_NUM_BUCKETS zend_mm_buckects into a fixed length array. and yes, my site might be blocked by chinese GFW, but you can try this: https://wiki.php.net/internals/zend_mm plz see the red part of the first picture.. thanks --=20 Laruence =C2=A0Xinchen Hui http://www.laruence.com/