diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-06-11 15:49:41 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-06-11 15:49:41 -0700 |
commit | ac8f8fcb27a063fbf7ec3ad3de18f6586e9e95b8 (patch) | |
tree | d4315e0d8a8c6d27d0883aa67461251ce4bbc59e /ndisasm.c | |
parent | 7b471fada8697930e4bdaff50fe51caa2798815f (diff) | |
download | nasm-ac8f8fcb27a063fbf7ec3ad3de18f6586e9e95b8.tar.gz nasm-ac8f8fcb27a063fbf7ec3ad3de18f6586e9e95b8.tar.bz2 nasm-ac8f8fcb27a063fbf7ec3ad3de18f6586e9e95b8.zip |
Use an explicit table for tolower() to avoid a function call
On some platforms, tolower() is implemented as a function call, in
order to handle locale support. We never change locales, so can the
result of tolower() into a table, so we don't have to sit through the
function call every time.
~1.3% overall performance improvement on a macro-heavy benchmark under
Linux x86-64.
Diffstat (limited to 'ndisasm.c')
-rw-r--r-- | ndisasm.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -67,6 +67,7 @@ int main(int argc, char **argv) int32_t offset; FILE *fp; + tolower_init(); nasm_set_malloc_error(ndisasm_error); offset = 0; @@ -77,7 +78,7 @@ int main(int argc, char **argv) if (*p == '-' && p[1]) { p++; while (*p) - switch (tolower(*p)) { + switch (nasm_tolower(*p)) { case 'a': /* auto or intelligent sync */ case 'i': autosync = true; |