cvs: ZendEngine2 / zend_alloc.c
| From: | Ilia Alshanetsky | Date: | Thu, 18 Aug 2005 15:02:10 +0000 |
| Subject: | cvs: ZendEngine2 / zend_alloc.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4037@lists.php.net to get a copy of this message | ||
iliaa Thu Aug 18 11:02:10 2005 EDT
Modified files:
/ZendEngine2 zend_alloc.c
Log:
Fixed bug #34156 (memory usage remains elevated after memory limit is reached)
http://cvs.php.net/diff.php/ZendEngine2/zend_alloc.c?r1=1.145&r2=1.146&ty=u
Index: ZendEngine2/zend_alloc.c
diff -u ZendEngine2/zend_alloc.c:1.145 ZendEngine2/zend_alloc.c:1.146
--- ZendEngine2/zend_alloc.c:1.145 Thu Aug 11 19:34:54 2005
+++ ZendEngine2/zend_alloc.c Thu Aug 18 11:02:10 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_alloc.c,v 1.145 2005/08/11 23:34:54 andrei Exp $ */
+/* $Id: zend_alloc.c,v 1.146 2005/08/18 15:02:10 iliaa Exp $ */
#include "zend.h"
#include "zend_alloc.h"
@@ -76,7 +76,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); \