cvs: ZendEngine2(PHP_5_0) / zend_alloc.c
| From: | Ilia Alshanetsky | Date: | Thu, 18 Aug 2005 15:14:23 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_0) / zend_alloc.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4042@lists.php.net to get a copy of this message | ||
iliaa Thu Aug 18 11:14:23 2005 EDT
Modified files: (Branch: PHP_5_0)
/ZendEngine2 zend_alloc.c
Log:
MFH: Fixed bug #34156 (memory usage remains elevated after memory limit is
reached)
http://cvs.php.net/diff.php/ZendEngine2/zend_alloc.c?r1=1.137.2.3&r2=1.137.2.4&ty=u
Index: ZendEngine2/zend_alloc.c
diff -u ZendEngine2/zend_alloc.c:1.137.2.3 ZendEngine2/zend_alloc.c:1.137.2.4
--- ZendEngine2/zend_alloc.c:1.137.2.3 Thu Apr 7 17:05:18 2005
+++ ZendEngine2/zend_alloc.c Thu Aug 18 11:14:23 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_alloc.c,v 1.137.2.3 2005/04/07 21:05:18 sniper Exp $ */
+/* $Id: zend_alloc.c,v 1.137.2.4 2005/08/18 15:14:23 iliaa Exp $ */
#include "zend.h"
#include "zend_alloc.h"
@@ -75,7 +75,8 @@
#define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { AG(allocated_memory) += rs;\
if (AG(memory_limit)<AG(allocated_memory)) {\
int php_mem_limit = AG(memory_limit); \
- if (EG(in_execution) && AG(memory_limit)+1048576 > AG(allocated_memory) - rs) {
\
+ AG(allocated_memory) -= rs; \
+ if (EG(in_execution) && AG(memory_limit)+1048576 > AG(allocated_memory)) { \
AG(memory_limit) = AG(allocated_memory) + 1048576; \
if (file) { \
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to
allocate %d bytes)", php_mem_limit, file, lineno, s); \