Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85966 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30314 invoked from network); 27 Apr 2015 10:57:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Apr 2015 10:57:52 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-wg0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:36410] helo=mail-wg0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/A5-17556-F261E355 for ; Mon, 27 Apr 2015 06:57:51 -0400 Received: by wgen6 with SMTP id n6so111406672wge.3 for ; Mon, 27 Apr 2015 03:57:49 -0700 (PDT) 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=cNldwaHTXhTXki5+oTJvvMUB3IfNxzKRlEWqrZpzKA0=; b=ULIb1U3fvcuRP2ie69Ii0lJKbzMjQi8u0HZVI1mbVkQ63jIMyQrspWr06FVP5er3zZ VzXmjvvXnWvxSX9GsfNZufGxx7QANEI+RhtzXZLtn4YK9eP5fD/9CyvNTsdT1oav9KNh WGpdYjrUZ5C7sRIdZIT2V5JpYlmEBXaJVdU2x32x2upcKZCBEjo8DLLskrE9v6UOIqV6 Gv9eTdIze2MTAkEupea8axZ2HgD6K08ud7tI78Hg8PyNayB5bVZoFvMXdiK0UyhEbFpB c3Z5I/zHk0oD6PzqWA9nNGxPNuowlkx9en5ocr/BGtG6ZP7ngZ8AFejs2/sLWezf4+9M H4ng== MIME-Version: 1.0 X-Received: by 10.180.79.227 with SMTP id m3mr19641859wix.71.1430132268964; Mon, 27 Apr 2015 03:57:48 -0700 (PDT) Received: by 10.27.86.133 with HTTP; Mon, 27 Apr 2015 03:57:48 -0700 (PDT) In-Reply-To: References: Date: Mon, 27 Apr 2015 12:57:48 +0200 Message-ID: To: Kalle Sommer Nielsen Cc: Internals Content-Type: multipart/alternative; boundary=14dae9cc9f96dfa25c0514b29d33 Subject: Re: [PHP-DEV] Tweaks to memory_get_usage() and memory_get_peak_usage() From: nikita.ppv@gmail.com (Nikita Popov) --14dae9cc9f96dfa25c0514b29d33 Content-Type: text/plain; charset=UTF-8 On Mon, Apr 27, 2015 at 9:26 AM, Kalle Sommer Nielsen wrote: > Howdy > > After working with a couple of projects, I found it a little annoying > that I would have to call memory_get_usage() twice first for > emalloc()'d memory and after again for real memory, so I made a small > patch that allows retrieving both values in a single call[1]. > > The patch itself is rather simple, and does the same thing to > memory_get_peak_usage(). It defines 3 constants: MEMORY_BOTH, > MEMORY_EMALLOC & MEMORY_REAL. These allows code written prior this > patch (if merged) to be compatible. > > > Any objections for 7? > > > [1] http://pastie.org/10115733 > So basically this replaces $data = ['emalloc' => memory_get_usage(), 'real' => memory_get_usage(true)]; with $data = memory_get_usage(MEMORY_BOTH); I don't think this change is really worthwhile... Nikita --14dae9cc9f96dfa25c0514b29d33--