diff options
author | Sebastian Pop <s.pop@samsung.com> | 2019-01-25 11:44:46 -0600 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2019-03-01 11:40:23 +0100 |
commit | 1cd1b4eb0eddbe8c142d8a7223fde9bc212739dd (patch) | |
tree | e7fc953c1b6bf986d170c7e93aa93fbf4b97a39f /inflate.c | |
parent | d5480df526b5a19ee2fcfce93b8121d2cdfb70ef (diff) |
ARM: check cpu feature once at init time
This makes the checks for arm cpu features as inexpensive as on the x86 side
by calling the runtime feature detection once in deflate/inflate init and then
storing the result in a global variable.
Diffstat (limited to 'inflate.c')
-rw-r--r-- | inflate.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -189,6 +189,12 @@ int ZEXPORT PREFIX(inflateInit2_)(PREFIX3(stream) *strm, int windowBits, const c int ret; struct inflate_state *state; +#ifdef X86_CPUID + x86_check_features(); +#elif defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) + arm_check_features(); +#endif + if (version == NULL || version[0] != PREFIX2(VERSION)[0] || stream_size != (int)(sizeof(PREFIX3(stream)))) return Z_VERSION_ERROR; if (strm == NULL) |