comparison mercurial/compat.h @ 33944:f4433f2713d0

encoding: add function to test if a str consists of ASCII characters Most strings are ASCII. Let's optimize for it. Using uint64_t is slightly faster than uint32_t on 64bit system, but there isn't huge difference.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 23 Apr 2017 12:59:42 +0900
parents 7b22599dcb85
children 11ed2eadf937
comparison
equal deleted inserted replaced
33943:2c37f9dabc32 33944:f4433f2713d0
5 #ifdef _MSC_VER 5 #ifdef _MSC_VER
6 /* msvc 6.0 has problems */ 6 /* msvc 6.0 has problems */
7 #define inline __inline 7 #define inline __inline
8 #if defined(_WIN64) 8 #if defined(_WIN64)
9 typedef __int64 ssize_t; 9 typedef __int64 ssize_t;
10 typedef unsigned __int64 uintptr_t;
10 #else 11 #else
11 typedef int ssize_t; 12 typedef int ssize_t;
13 typedef unsigned int uintptr_t;
12 #endif 14 #endif
13 typedef signed char int8_t; 15 typedef signed char int8_t;
14 typedef short int16_t; 16 typedef short int16_t;
15 typedef long int32_t; 17 typedef long int32_t;
16 typedef __int64 int64_t; 18 typedef __int64 int64_t;