diff options
author | Monty <monty@mariadb.org> | 2015-07-09 13:09:36 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-07-09 13:09:36 +0300 |
commit | a6c801438717b815288acb72513f5e42fe736b7b (patch) | |
tree | df887645ce912b82420807d7becbbac45e10b90d /sql/unireg.h | |
parent | 7332af49e4ce125a5e316e7e0c82d44df4af54c4 (diff) | |
download | mariadb-git-a6c801438717b815288acb72513f5e42fe736b7b.tar.gz |
Speed and code space optimziation:
- Cache variables.lc_messages->errmsgs->errmsgs in variables.errmsgs
This gives us 15 byte less code space and 2 memory references for any access to language dependent message,
of which there are 500 in the server..
Diffstat (limited to 'sql/unireg.h')
-rw-r--r-- | sql/unireg.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/unireg.h b/sql/unireg.h index 8e73fd8da18..7599003566c 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -43,15 +43,14 @@ #define PLUGINDIR "lib/plugin" #endif -#define CURRENT_THD_ERRMSGS current_thd->variables.lc_messages->errmsgs->errmsgs +#define CURRENT_THD_ERRMSGS current_thd->variables.errmsgs #define DEFAULT_ERRMSGS my_default_lc_messages->errmsgs->errmsgs #define ER(X) CURRENT_THD_ERRMSGS[(X) - ER_ERROR_FIRST] #define ER_DEFAULT(X) DEFAULT_ERRMSGS[(X) - ER_ERROR_FIRST] #define ER_SAFE(X) (((X) >= ER_ERROR_FIRST && (X) <= ER_ERROR_LAST) ? ER(X) : "Invalid error code") #define ER_SAFE_THD(T,X) (((X) >= ER_ERROR_FIRST && (X) <= ER_ERROR_LAST) ? ER_THD(T,X) : "Invalid error code") -#define ER_THD(thd,X) ((thd)->variables.lc_messages->errmsgs->errmsgs[(X) - \ - ER_ERROR_FIRST]) +#define ER_THD(thd,X) ((thd)->variables.errmsgs[(X) - ER_ERROR_FIRST]) #define ER_THD_OR_DEFAULT(thd,X) ((thd) ? ER_THD(thd, X) : ER_DEFAULT(X)) #define ME_INFO (ME_HOLDTANG+ME_OLDWIN+ME_NOREFRESH) |