Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64836 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51929 invoked from network); 10 Jan 2013 23:34:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2013 23:34:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.54 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.219.54 mail-oa0-f54.google.com Received: from [209.85.219.54] ([209.85.219.54:44860] helo=mail-oa0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id ED/E1-02684-8005FE05 for ; Thu, 10 Jan 2013 18:34:32 -0500 Received: by mail-oa0-f54.google.com with SMTP id n9so1223014oag.27 for ; Thu, 10 Jan 2013 15:34:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GpDkmTX5MYnLGj39L61vJo7dKCe8KUibuJssRP/SK6g=; b=knXshV2qiNVc2FfgX6GOtu1CeJip/zVQtJm3HZrwf+4BRICHaujOl+FMkyYuC3Smxv SjHKGAl5+QyVgQPGydAFe0pKbA+c0QqSJCPpdaXTGA1gbU4/Cf+nNviMUILBEA0iMhcS xfDmbtAvSS0fcZW3cPB2ULdRNSOaUNzaSLwrk9GxuPkzF3ZeBiREWGJo64IFHrbxe6AY CdNvdokqVus9x9FfwuEH01f4nbKd9PWsycQbYNZkqfT08DLN9ohPz5IADuddEDSsOV65 PkVGfHtOo++fTBXqm0M0rJZ3FCGeIc4Pslcn2n+k96O7NKJZVRSvmJQiydaJIe8s6oxM qVKg== MIME-Version: 1.0 Received: by 10.60.32.235 with SMTP id m11mr44782374oei.129.1357860869411; Thu, 10 Jan 2013 15:34:29 -0800 (PST) Received: by 10.76.82.234 with HTTP; Thu, 10 Jan 2013 15:34:29 -0800 (PST) In-Reply-To: <50EF39B6.1080703@sugarcrm.com> References: <50EF39B6.1080703@sugarcrm.com> Date: Thu, 10 Jan 2013 16:34:29 -0700 Message-ID: To: Stas Malyshev Cc: Gustavo Lopes , internals PHP Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Add a zend_qsort_r/zend_qsort implementation From: morrison.levi@gmail.com (Levi Morrison) On Thu, Jan 10, 2013 at 2:59 PM, Stas Malyshev wrote: >> We could export zend_qsort_r starting in 5.5; I need it ext/standard so >> it need not be exported, which would be problematic on a stable branch. >> It's undefined behavior because the comparison function is being called >> with one extra pointer argument. This is the same technique glibc uses >> though, so it should be safe. I could not find any measurable >> performance penalty. > > I think this is OK for 5.5, but I'm kind of worried about the function > parameter mismatch. PHP is run on all kinds of platforms, including > those where glibc is never heard of :) Are we sure it's safe on all > platforms to do this? I urge you to be very careful. I compile PHP on intel compilers and have seen some performance benefit to doing so. Make sure it is cross-platform, please.