Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85965 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28739 invoked from network); 27 Apr 2015 10:52:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Apr 2015 10:52:26 -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.216.45 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.216.45 mail-vn0-f45.google.com Received: from [209.85.216.45] ([209.85.216.45:43696] helo=mail-vn0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/45-17556-9E41E355 for ; Mon, 27 Apr 2015 06:52:25 -0400 Received: by vnbg7 with SMTP id g7so11272565vnb.10 for ; Mon, 27 Apr 2015 03:52:22 -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=QARashwDxG0/4bYW8q8E52JgUSx5v3t95K41PeXxVmI=; b=iL/FEZUfYswzBN5q5C78CWhBbjOddrMfpJyuigEvlNbgrQ7fF6j5jKesabx7XzVITY zUj24PQjvLaspa0q1LYL7d1JQjsAzI2AXwzt2L7OXXyY236Bt1lgnRGzWZ4yQjOmWKKL ClUrmKryIZST71dMCTkMF5e5sPBdv8ylqUh7P3riqd7PCVLez7dDzl6lQuZ2vNLV9ceq GsyYwIyYJqKfyJGDBCLIGyowQ4umbFDoTEVMRdzuv8DPRiBGZSyjEkQTIfpfGei3HoEU oBt8LCDHwFLHfktL2PieWyiOOy+1n9lLQTw4oF1RjMeAvryndGIDbkE4bDvkX+mbi96H bGVQ== X-Gm-Message-State: ALoCoQklmE1kG5AMeAAVHAqVvnhIfOuJHm2ogk/F3C1Q9IFEB3kvbWiVTmttlBP6yEhyyzC7Hbv8icKI+4vC/bt5d0Moc0xjJGbB3KnO2VQ+bNgcU7WAU3zlMzSH8FlDDxJGS8eomRIKiXVZvRfcYVFg77r0kbucCA== MIME-Version: 1.0 X-Received: by 10.52.142.115 with SMTP id rv19mr25842257vdb.78.1430131942646; Mon, 27 Apr 2015 03:52:22 -0700 (PDT) Received: by 10.52.33.235 with HTTP; Mon, 27 Apr 2015 03:52:22 -0700 (PDT) In-Reply-To: References: Date: Mon, 27 Apr 2015 13:52:22 +0300 Message-ID: To: Kalle Sommer Nielsen Cc: Internals Content-Type: multipart/alternative; boundary=bcaec51b9adb6c71420514b28a17 Subject: Re: [PHP-DEV] Tweaks to memory_get_usage() and memory_get_peak_usage() From: dmitry@zend.com (Dmitry Stogov) --bcaec51b9adb6c71420514b28a17 Content-Type: text/plain; charset=UTF-8 Hi Kalle, I don't think we should support all possible use cases introducing new C functions and modifiers. Users already have ability to get all the necessary information, and they may wrap memory_get_udage() as they like. Thanks. Dmitry. On Mon, Apr 27, 2015 at 10: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 > > -- > regards, > > Kalle Sommer Nielsen > kalle@php.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --bcaec51b9adb6c71420514b28a17--