diff options
author | Anatol Belski <ab@php.net> | 2014-09-30 19:16:23 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-09-30 19:16:23 +0200 |
commit | 24f9c924d70bce7ecf374b30bb12deab5cb89e57 (patch) | |
tree | 5cd6dea507b0dc261a74f5ba6e95cdc2be43eeaf | |
parent | d624b0d5ebb010db5f3e2612a2820b0557c5ba74 (diff) | |
download | php-git-24f9c924d70bce7ecf374b30bb12deab5cb89e57.tar.gz |
prepare some macros to use tsrm cache as pointer
instead of a function call
-rw-r--r-- | TSRM/TSRM.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h index 41cd9485e7..89d213348c 100644 --- a/TSRM/TSRM.h +++ b/TSRM/TSRM.h @@ -157,6 +157,12 @@ TSRM_API void tsrm_free_interpreter_context(void *context); TSRM_API inline void *tsrm_get_ls_cache(void); +#ifdef TSRM_WIN32 +# define TSRM_TLS __declspec(thread) +#else +# define TSRM_TLS __thread +#endif + #define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1) #define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1) @@ -164,6 +170,7 @@ TSRM_API inline void *tsrm_get_ls_cache(void); #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 TSRMGP(id, type, element) (((type) (*((void ***) tsrm_ls_cache))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element) #define TSRMLS_D #define TSRMLS_DC #define TSRMLS_C |