Tweaks to memory_get_usage() and memory_get_peak_usage()
| From: | Kalle Sommer Nielsen | Date: | Mon, 27 Apr 2015 07:26:01 +0000 |
| Subject: | Tweaks to memory_get_usage() and memory_get_peak_usage() | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-85961@lists.php.net to get a copy of this message | ||
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