add in a memory limit fix patch

pointed out by heko@iki.fi
This commit is contained in:
avsm 2001-08-11 00:16:56 +00:00
parent 010ed4a3f0
commit 4555f09b3c

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-Zend_zend_alloc_c,v 1.1 2001/08/11 00:16:56 avsm Exp $
--- Zend/zend_alloc.c.orig Tue Jun 19 18:04:53 2001
+++ Zend/zend_alloc.c Sat Aug 11 00:07:15 2001
@@ -446,6 +446,9 @@ ZEND_API void shutdown_memory_manager(in
for (i=1; i<MAX_CACHED_MEMORY; i++) {
for (j=0; j<AG(cache_count)[i]; j++) {
ptr = (zend_mem_header *) AG(cache)[i][j];
+#if MEMORY_LIMIT
+ AG(allocated_memory) -= REAL_SIZE(ptr->size);
+#endif
REMOVE_POINTER_FROM_LIST(ptr);
free(ptr);
}