Simple optimizations
Why open-coding isdigit is a good idea?
Before: call __ctype_b_loc
movzbl (%ebx),%edx
mov (%eax),%eax
testb $0x8,0x1(%eax,%edx,2)
je lbl
After: movzbl (%eax),%edx
sub $0x30,%edx
cmp $0x9,%dl
ja lbl
text data bss dec hex filename
236869 704 18944 256517 3ea05 strace.before
236719 700 18944 256363 3e96b strace
* defs.h: Alias sigemptyset to __sigemptyset on glibc.
* syscall.c (qual_syscall): Open-code isdigit.
(qual_desc): Likewise.
(qual_signal): Open-code isdigit. Remove string copying
which was done for no apparent reason.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/defs.h b/defs.h
index a0445c3..e46e230 100644
--- a/defs.h
+++ b/defs.h
@@ -83,6 +83,13 @@
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+/* Glibc has an efficient macro for sigemptyset
+ * (it just does one or two assignments of 0 to internal vector of longs).
+ */
+#if defined(__GLIBC__) && defined(__sigemptyset) && !defined(sigemptyset)
+# define sigemptyset __sigemptyset
+#endif
+
/* Configuration section */
#ifndef MAX_QUALS
# if defined(MIPS)