diff options
author | lijunlong <lijunlong@openresty.com> | 2023-02-22 21:34:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-22 21:34:30 +0800 |
commit | 41eee7406b0f048392168515b09e7d8bdd000624 (patch) | |
tree | 987f37890364caf90a1229113b7ba80a9c8ca185 /fpconv.h | |
parent | de93a78d3002ee72bb1c7e3a629d67e19623a4ae (diff) | |
download | lua-cjson-41eee7406b0f048392168515b09e7d8bdd000624.tar.gz lua-cjson-41eee7406b0f048392168515b09e7d8bdd000624.tar.bz2 lua-cjson-41eee7406b0f048392168515b09e7d8bdd000624.zip |
Add updated netlib dtoa.c from https://netlib.sandia.gov/fp/dtoa.c
Co-authored-by: Jesper Lundgren <jesperlundgren@exosite.com>
Diffstat (limited to 'fpconv.h')
-rw-r--r-- | fpconv.h | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -7,10 +7,20 @@ | |||
7 | # define FPCONV_G_FMT_BUFSIZE 32 | 7 | # define FPCONV_G_FMT_BUFSIZE 32 |
8 | 8 | ||
9 | #ifdef USE_INTERNAL_FPCONV | 9 | #ifdef USE_INTERNAL_FPCONV |
10 | static inline void fpconv_init(void) | 10 | #ifdef MULTIPLE_THREADS |
11 | #include "dtoa_config.h" | ||
12 | #include <unistd.h> | ||
13 | static inline void fpconv_init() | ||
14 | { | ||
15 | // Add one to try and avoid core id multiplier alignment | ||
16 | set_max_dtoa_threads((sysconf(_SC_NPROCESSORS_CONF) + 1) * 3); | ||
17 | } | ||
18 | #else | ||
19 | static inline void fpconv_init() | ||
11 | { | 20 | { |
12 | /* Do nothing - not required */ | 21 | /* Do nothing - not required */ |
13 | } | 22 | } |
23 | #endif | ||
14 | #else | 24 | #else |
15 | extern void fpconv_init(void); | 25 | extern void fpconv_init(void); |
16 | #endif | 26 | #endif |