Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77094 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3383 invoked from network); 8 Sep 2014 07:06:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2014 07:06:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.169 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.169 mail-vc0-f169.google.com Received: from [209.85.220.169] ([209.85.220.169:63892] helo=mail-vc0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 44/B0-26504-C555D045 for ; Mon, 08 Sep 2014 03:06:04 -0400 Received: by mail-vc0-f169.google.com with SMTP id hq11so14937802vcb.14 for ; Mon, 08 Sep 2014 00:06:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=e8ZlqmcXzjlmC6DobV9e6zCn2DsOA1mDSfZ5F9lme3A=; b=Iy696pUZqXP+qhHdd+XiSNZWb4gkCdPcjUq6HuXN5ijcsvTqrzw5gsJCWuhIr1HIZx h7ptpQ0PkJZvUyhEK1N1ToMYQVYCX8BIRIQbXnRIYUD9fKCrUZVXU8FWK/6HvDZaDhYW VDCm3pNHiAYm79WE2pS++ntlehnLSQYU/QEVd2y7zpGSKsi4UmS5fe+1EvaTFCQ33Vqn yHT1lW+BbpotfpAChxrQsJcZRyKU0uwjumFGJo/7aRjEJK+IgaxVKJzrHuB0TKioVK3Q sVAXYCvAzA1w1j+PWQExsUz28rYpuFVluMQ/BRcXprJZQ3LZ9baFCASowWLpV00dS4D/ lLVA== X-Gm-Message-State: ALoCoQm14AChfKvU2HLQpg7zjzKVgqKGN8+0AmYUuUjX6jTcDL22bsDzsjjInA4bTitfaUEELHfg41DYO8j96WqzZZrk4f2GRJm52b8r/O7/R+MBpeN6NDqcvqmschQiYmwiyVA4RDzlgMsuZtrMrncefh9qJuilzQ== MIME-Version: 1.0 X-Received: by 10.221.23.198 with SMTP id rb6mr23832516vcb.19.1410159961174; Mon, 08 Sep 2014 00:06:01 -0700 (PDT) Received: by 10.52.110.170 with HTTP; Mon, 8 Sep 2014 00:06:01 -0700 (PDT) In-Reply-To: <82DDEFF351B5484A85DD56599B8E8988@pc1> References: <82DDEFF351B5484A85DD56599B8E8988@pc1> Date: Mon, 8 Sep 2014 11:06:01 +0400 Message-ID: To: Matt Wilmas Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11337fb09009be0502887376 Subject: Re: zend_mm_small_size_to_bit From: dmitry@zend.com (Dmitry Stogov) --001a11337fb09009be0502887376 Content-Type: text/plain; charset=UTF-8 Hi Matt, You are right about zend_mm_small_size_to_bit(). It's result must be undefined for 0 and corresponding part of non-GCC version may be removed as well. I'll do it. Thanks. Dmitry. On Fri, Sep 5, 2014 at 8:00 PM, Matt Wilmas wrote: > Hi Dmitry, all, > > I was looking through a few parts of the new MM last week (cool, thanks! I > will try soon on my Windows XP), and wasn't sure about the function in the > subject... > > This: > > /* higher set bit number (0->0, 1->1, 2->2, 4->3, 8->4, 127->7, 128->8 > etc) */ > static zend_always_inline int zend_mm_small_size_to_bit(int size) > { > #if defined(__GNUC__) > return (__builtin_clz(size) ^ 0x1f) + 1; > > Will never return 0, right? (Against the comment...) That's OK I guess > since, for now, it's only called with size >= 8. > > But in that case, this can be removed from the non-GCC version: > > if (size == 0) return 0; > > Shouldn't have just one version able to return 0? :-/ Unless I'm missing > something! Let me know... > > > Thanks, > Matt > --001a11337fb09009be0502887376--