diff options
author | krakjoe <joe.watkins@live.co.uk> | 2014-09-27 17:11:56 +0100 |
---|---|---|
committer | krakjoe <joe.watkins@live.co.uk> | 2014-09-27 17:11:56 +0100 |
commit | 7d4f7c04b3057e41b617e33816119755e0a4fd73 (patch) | |
tree | db748420d38e69586eccac93bf77bee5cb5b484f /TSRM | |
parent | 3e5dd17dada58634d85363e74b53c00ecd7201b2 (diff) | |
download | php-git-7d4f7c04b3057e41b617e33816119755e0a4fd73.tar.gz |
approach local pointers in performance sensitive areas
Diffstat (limited to 'TSRM')
-rw-r--r-- | TSRM/TSRM.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h index 41cd9485e7..8290216753 100644 --- a/TSRM/TSRM.h +++ b/TSRM/TSRM.h @@ -160,10 +160,13 @@ TSRM_API inline void *tsrm_get_ls_cache(void); #define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1) #define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1) -#define TSRMLS_FETCH() void ***tsrm_ls = (void ***) ts_resource_ex(0, NULL) -#define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx -#define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_get_ls_cache() -#define TSRMG(id, type, element) (((type) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element) +#define TSRMLS_FETCH() void ***tsrm_ls = (void ***) ts_resource_ex(0, NULL) +#define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx +#define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_get_ls_cache() +#define TSRMX(name) tsrm_ls_cache_##name +#define TSRMX_D(name) static void*** TSRMX(name) +#define TSRMGX(cache, id, type, element) (((type) (*((void ***) cache))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element) +#define TSRMG(id, type, element) TSRMGX(tsrm_get_ls_cache(), id, type, element) #define TSRMLS_D #define TSRMLS_DC #define TSRMLS_C |