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
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 kalle@php.net
wrote:
Howdy
After working with a couple of projects, I found it a little annoying
that I would have to callmemory_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
Howdy
After working with a couple of projects, I found it a little annoying
that I would have to callmemory_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?
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