diff options
author | Zeev Suraski <zeev@php.net> | 2000-02-19 19:21:45 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2000-02-19 19:21:45 +0000 |
commit | ceba50b6edc03128c29dfa96bfcb93d299654710 (patch) | |
tree | e4b7da9e953001a1d926c521d38ee16ca36daf25 /Zend/zend_fast_cache.h | |
parent | eb9d7998769d6bafcdf28b61257ed16528b5d7b2 (diff) | |
download | php-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.h | 28 |
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 */ /* |