summaryrefslogtreecommitdiff
path: root/Zend/zend_fast_cache.h
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-02-19 19:21:45 +0000
committerZeev Suraski <zeev@php.net>2000-02-19 19:21:45 +0000
commitceba50b6edc03128c29dfa96bfcb93d299654710 (patch)
treee4b7da9e953001a1d926c521d38ee16ca36daf25 /Zend/zend_fast_cache.h
parenteb9d7998769d6bafcdf28b61257ed16528b5d7b2 (diff)
downloadphp-git-ceba50b6edc03128c29dfa96bfcb93d299654710.tar.gz
- Fix a nasty bug in the hash, introduced in the recent migration to macros
- Make array_init() and friends trackable
Diffstat (limited to 'Zend/zend_fast_cache.h')
-rw-r--r--Zend/zend_fast_cache.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/Zend/zend_fast_cache.h b/Zend/zend_fast_cache.h
index f62f0ee12a..2f0f73c13a 100644
--- a/Zend/zend_fast_cache.h
+++ b/Zend/zend_fast_cache.h
@@ -78,6 +78,12 @@ typedef struct _zend_fast_cache_list_entry {
AG(fast_cache_list_head)[fc_type] = (zend_fast_cache_list_entry *) (p); \
}
+#define ZEND_FAST_ALLOC_REL(p, type, fc_type) \
+ ZEND_FAST_ALLOC(p, type, fc_type)
+
+#define ZEND_FAST_FREE_REL(p, fc_type) \
+ ZEND_FAST_FREE(p, fc_type)
+
#else /* !ZEND_ENABLE_FAST_CACHE */
@@ -87,6 +93,12 @@ typedef struct _zend_fast_cache_list_entry {
#define ZEND_FAST_FREE(p, fc_type) \
efree(p)
+#define ZEND_FAST_ALLOC_REL(p, type, fc_type) \
+ (p) = (type *) emalloc_rel(sizeof(type))
+
+#define ZEND_FAST_FREE_REL(p, fc_type) \
+ efree_rel(p)
+
#endif /* ZEND_ENABLE_FAST_CACHE */
@@ -99,13 +111,25 @@ typedef struct _zend_fast_cache_list_entry {
#define FREE_ZVAL(z) \
ZEND_FAST_FREE(z, ZVAL_CACHE_LIST)
+#define ALLOC_ZVAL_REL(z) \
+ ZEND_FAST_ALLOC_REL(z, zval, ZVAL_CACHE_LIST)
+
+#define FREE_ZVAL_REL(z) \
+ ZEND_FAST_FREE_REL(z, ZVAL_CACHE_LIST)
+
/* fast cache for HashTable's */
-#define ALLOC_HASHTABLE(b) \
- ZEND_FAST_ALLOC(b, HashTable, HASHTABLE_CACHE_LIST)
+#define ALLOC_HASHTABLE(ht) \
+ ZEND_FAST_ALLOC(ht, HashTable, HASHTABLE_CACHE_LIST)
#define FREE_HASHTABLE(ht) \
ZEND_FAST_FREE(ht, HASHTABLE_CACHE_LIST)
+#define ALLOC_HASHTABLE_REL(ht) \
+ ZEND_FAST_ALLOC_REL(ht, HashTable, HASHTABLE_CACHE_LIST)
+
+#define FREE_HASHTABLE_REL(ht) \
+ ZEND_FAST_FREE_REL(ht, HASHTABLE_CACHE_LIST)
+
#endif /* _ZEND_FAST_CACHE_H */
/*