the code cleaner.
- ZTS compile fixes
\r
SOURCE=.\zend_variables.h\r
# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\zend_zval_alloc.h\r
+# End Source File\r
# End Group\r
# Begin Group "Parsers"\r
\r
\r
SOURCE=.\zend_variables.h\r
# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\zend_zval_alloc.h\r
+# End Source File\r
# End Group\r
# Begin Group "Parsers"\r
\r
ZEND_API void start_memory_manager(ALS_D)
{
AG(phead) = AG(head) = NULL;
+ AG(zval_list_head) = NULL;
#if MEMORY_LIMIT
AG(memory_limit)=1<<30; /* rediculous limit, effectively no limit */
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
+ zend_zval_list_entry *zval_list_entry, *next_zval_list_entry;
ALS_FETCH();
-#if !ZEND_DEBUG
zval_list_entry = AG(zval_list_head);
while (zval_list_entry) {
next_zval_list_entry = zval_list_entry->next;
zval_list_entry = next_zval_list_entry;
}
AG(zval_list_head) = NULL;
-#endif
p=AG(head);
t=AG(head);
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_globals_macros.h"
#include "zend_alloc.h"
-#if ZEND_DEBUG
-
-# define ALLOC_ZVAL(z) (z) = emalloc(sizeof(zval))
-# define FREE_ZVAL(z) efree(z)
-
-#else /* !ZEND_DEBUG */
-
-extern zend_alloc_globals alloc_globals;
-
typedef struct _zend_zval_list_entry {
struct _zend_zval_list_entry *next;
} zend_zval_list_entry;
+#ifndef ZTS
+extern zend_alloc_globals alloc_globals;
+#endif
+
#define ALLOC_ZVAL(z) \
{ \
ALS_FETCH(); \
}
-#define FREE_ZVAL(z) \
- { \
+#define FREE_ZVAL(z) \
+ { \
+ ALS_FETCH(); \
+ \
((zend_zval_list_entry *) (z))->next = AG(zval_list_head); \
AG(zval_list_head) = (zend_zval_list_entry *) (z); \
}
-#endif /* !ZEND_DEBUG */
-
#endif
/*