#define INIT_ZVAL(z) z = zval_used_for_init;
-#define ALLOC_ZVAL(z) (z) = (zval *) emalloc(sizeof(zval))
-
-#define FREE_ZVAL(z) efree(z)
-
#define ALLOC_INIT_ZVAL(zp) \
ALLOC_ZVAL(zp); \
INIT_ZVAL(*zp);
#include "modules.h"
#include "zend_list.h"
+#include "zend_zval_alloc.h"
#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
#include "zend.h"
#include "zend_alloc.h"
#include "zend_globals.h"
+#include "zend_zval_alloc.h"
#ifdef HAVE_SIGNAL_H
# include <signal.h>
#endif
#endif
#ifndef ZTS
-static zend_alloc_globals alloc_globals;
+zend_alloc_globals alloc_globals;
#endif
AG(memory_exhausted)=0;
#endif
+#if ZEND_DEBUG
+ AG(zval_list_head) = NULL;
+#endif
+
memset(AG(cache_count),0,MAX_CACHED_MEMORY*sizeof(unsigned char));
}
zend_mem_header *p, *t;
#if ZEND_DEBUG
int had_leaks=0;
+#else
+ zend_zval_list_entry *zval_list_entry, *next_zval_list_entry;
#endif
ALS_FETCH();
+#if !ZEND_DEBUG
+ zval_list_entry = AG(zval_list_head);
+ while (zval_list_entry) {
+ next_zval_list_entry = zval_list_entry->next;
+ efree(zval_list_entry);
+ zval_list_entry = next_zval_list_entry;
+ }
+ AG(zval_list_head) = NULL;
+#endif
+
p=AG(head);
t=AG(head);
while (t) {
#include "zend_API.h"
#include "zend_variables.h"
#include "zend_operators.h"
+#include "zend_zval_alloc.h"
ZEND_API zend_op_array *(*zend_compile_files)(int mark_as_ref CLS_DC, int file_count, ...);
#include "zend_operators.h"
#include "zend_constants.h"
#include "zend_extensions.h"
+#include "zend_zval_alloc.h"
#if defined(HAVE_ALLOCA) && defined(HAVE_ALLOCA_H)
# include <alloca.h>
zend_mem_header *phead; /* persistent list */
void *cache[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
unsigned char cache_count[MAX_CACHED_MEMORY];
+#if !ZEND_DEBUG
+ void *zval_list_head;
+#endif
#if MEMORY_LIMIT
unsigned int memory_limit;
#include "zend_variables.h"
#include "zend_globals.h"
#include "zend_list.h"
+#include "zend_zval_alloc.h"
#if WITH_BCMATH
#include "functions/number.h"