com php-src: prepare some macros to use tsrm cache as pointer: TSRM/TSRM.h

From: Date: Tue, 30 Sep 2014 17:16:23 +0000
Subject: com php-src: prepare some macros to use tsrm cache as pointer: TSRM/TSRM.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-82021@lists.php.net to get a copy of this message
Commit: 24f9c924d70bce7ecf374b30bb12deab5cb89e57 Author: Anatol Belski <ab@php.net> Tue, 30 Sep 2014 19:16:23 +0200 Parents: d624b0d5ebb010db5f3e2612a2820b0557c5ba74 Branches: native-tls Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=24f9c924d70bce7ecf374b30bb12deab5cb89e57 Log: prepare some macros to use tsrm cache as pointer instead of a function call Changed paths: M TSRM/TSRM.h Diff: diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h index 41cd948...89d2133 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

« previous php.cvs (#82021) next »