Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85961 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14093 invoked from network); 27 Apr 2015 07:26:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Apr 2015 07:26:07 -0000 Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.169 as permitted sender) X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.212.169 mail-wi0-f169.google.com Received: from [209.85.212.169] ([209.85.212.169:38159] helo=mail-wi0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/73-17556-C84ED355 for ; Mon, 27 Apr 2015 03:26:06 -0400 Received: by wiun10 with SMTP id n10so79207696wiu.1 for ; Mon, 27 Apr 2015 00:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=PY58R/xy5WZaAAp7gp98PbFwtZAHGmONamQPJECDoKU=; b=dvZqVCdIhaMsMwzsGOdHI5GNVHd9SVRFm+u6dcHwbZh7SsTS8IFyb9iBlvp5kBIkR/ z3V4Swv4TWrnOTriV3o+Mzaznqx0XyPADsyoGOTH9cXxo9hqBuWo//h7GbVltRYjMtrH loXAknHsoFIx909wgsEKW4f+9rOBh6EwH2bsFwqA1fUZN0dKOSVcrtDOgzeiKxZb8PJi j8aNrbrgJGc9ndZvctKM2LDc/K4uqrU8nlu5HBROR7OLgGugsHunZLQcobgXqmnm2HKM uyxE6XwJFRreo9V/EpOibFsQWKgZ6bgXJafhwfWH1GUxRd+GfPKYQSSPP5O2ykAL5kVG l46A== MIME-Version: 1.0 X-Received: by 10.194.184.45 with SMTP id er13mr20136180wjc.71.1430119562020; Mon, 27 Apr 2015 00:26:02 -0700 (PDT) Sender: kalle.php@gmail.com Received: by 10.28.217.19 with HTTP; Mon, 27 Apr 2015 00:26:01 -0700 (PDT) Date: Mon, 27 Apr 2015 09:26:01 +0200 X-Google-Sender-Auth: et-SXdnogD7B0K1S0iklCe8sYCg Message-ID: To: Internals Content-Type: text/plain; charset=UTF-8 Subject: Tweaks to memory_get_usage() and memory_get_peak_usage() From: kalle@php.net (Kalle Sommer Nielsen) 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 -- regards, Kalle Sommer Nielsen kalle@php.net