diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2005-08-18 15:14:12 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2005-08-18 15:14:12 +0000 |
commit | 3b329a992606889c9ca43b1fe5e68b11b1166247 (patch) | |
tree | 7582ea4629c067b71950f2f9dec8d03e2337c47c /Zend/zend_alloc.c | |
parent | 4e798f6e024846afcbd620b8efe7b2778c621bb9 (diff) | |
download | php-git-3b329a992606889c9ca43b1fe5e68b11b1166247.tar.gz |
MFH: Fixed bug #34156 (memory usage remains elevated after memory limit is
reached);
Diffstat (limited to 'Zend/zend_alloc.c')
-rw-r--r-- | Zend/zend_alloc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index f77c54ef9c..c9d18f31e2 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -75,7 +75,8 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC; #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); \ |