Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96718 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50372 invoked from network); 3 Nov 2016 13:48:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Nov 2016 13:48:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-wm0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:37592] helo=mail-wm0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/8B-34238-C204B185 for ; Thu, 03 Nov 2016 08:48:28 -0500 Received: by mail-wm0-f54.google.com with SMTP id t79so102185589wmt.0 for ; Thu, 03 Nov 2016 06:48:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6WejZKusSmV21LgatwrAxGNKtQBTITtZwI7Xtv8AzXU=; b=1C5bsouXwQMjH8Ms9J262Qmch5ZsmqIf83YI4xbGRsYMjg5CvSFYaXMsG4tVIgkmlb 1N+gPbsUstMGzJJtS+uGLezmUBNFdRz8TpMLpe2Pcfz0s7g8Yest/NwJ8izHx7d+xyV1 8Ie7jQF3ZLsjxnSnH9aUmzv94+QNIvz/xk+aWzCakWrHjv5NUutrw6iyHqFgl/bZwyjT UWWaEg1T/TEhakfz3pTfTIg6L9m2HAEYJhZsywS/xLIlB2FOni1LsrZF+63iD2WfHBvJ zjfucbTafdla+k6IfgXTqtkKl254AKPEqK28EiZwHg3b6pQ5X+4lqujNpFYZbzF4Z/et VOrA== 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:from:date :message-id:subject:to:cc; bh=6WejZKusSmV21LgatwrAxGNKtQBTITtZwI7Xtv8AzXU=; b=WfvdGGgEFEPlDAswxwZMyVbH01wVTQ0rziRPTNIJGhfb6OphLDD2oxRHxIZndaQPWp HuRvXIwRG9TuVNn5EiArTiQ83NPnJH1GmFY0SQWjE5T5OSD36JfBxiwGvltCVQF5f95W +4qe0OClDMvZw0tS2Rb2VQU/Ic+8sY8KnxPTkbVVVOZXV2oEnWWUqfwe7AtdueixQSEg v8n8hI5lKr1uGaBzNFNdNAkev7pzAS8oV/Rjc+KKMIMMPyY2isrgXDv1q5kxrnyw5XYR W3ZoU/mQy3qTzq8PkYiSsXncr47oS7afs0fzAyVOZEQra5fJUnikg9oQV84d+hnzS2+n E9pw== X-Gm-Message-State: ABUngvf001w2+5LjTqoyudjz8NOvkdGUFriit9E4NZxIigkejgV/V4+TVgHW11TS+0EWGKyjgKylAqgaL5cXfw== X-Received: by 10.28.213.74 with SMTP id m71mr1652380wmg.39.1478180904773; Thu, 03 Nov 2016 06:48:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.158.8 with HTTP; Thu, 3 Nov 2016 06:48:24 -0700 (PDT) In-Reply-To: <20161103133301.25B225FAAA@mx.zeyos.com> References: <20161103133301.25B225FAAA@mx.zeyos.com> Date: Thu, 3 Nov 2016 14:48:24 +0100 Message-ID: To: Benjamin Coutu Cc: Levi Morrison , PHP Internals , Dmitry Stogov Content-Type: multipart/alternative; boundary=001a11469770be41bf054065cf63 Subject: Re: [PHP-DEV] Algorithmic efficiency of zend_memrchr From: nikita.ppv@gmail.com (Nikita Popov) --001a11469770be41bf054065cf63 Content-Type: text/plain; charset=UTF-8 On Thu, Nov 3, 2016 at 2:33 PM, Benjamin Coutu wrote: > The type qualifier is just copy paste relic. We'd of course have to remove > const form the signature (and the function body) for this to work. Quickly > looking at zend_memrchr's call sites I don't see that it would be a huge > issue to modify that or am I missing something? > A lot of our strings are interned and live in SHM. Modifying them would cause memory corruption and race conditions. Just consider two memrchr operations on different characters operating on the same string in two different PHP processes. Nikita --001a11469770be41bf054065cf63--