aboutsummaryrefslogtreecommitdiff
path: root/dtoa_config.h
diff options
context:
space:
mode:
authorlijunlong <lijunlong@openresty.com>2023-02-22 21:34:30 +0800
committerGitHub <noreply@github.com>2023-02-22 21:34:30 +0800
commit41eee7406b0f048392168515b09e7d8bdd000624 (patch)
tree987f37890364caf90a1229113b7ba80a9c8ca185 /dtoa_config.h
parentde93a78d3002ee72bb1c7e3a629d67e19623a4ae (diff)
downloadlua-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 'dtoa_config.h')
-rw-r--r--dtoa_config.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/dtoa_config.h b/dtoa_config.h
index 380e83b..c168e28 100644
--- a/dtoa_config.h
+++ b/dtoa_config.h
@@ -24,7 +24,7 @@
24#define IEEE_8087 24#define IEEE_8087
25#endif 25#endif
26 26
27#define MALLOC(n) xmalloc(n) 27#define MALLOC xmalloc
28 28
29static void *xmalloc(size_t size) 29static void *xmalloc(size_t size)
30{ 30{
@@ -50,6 +50,10 @@ static pthread_mutex_t private_dtoa_lock[2] = {
50 PTHREAD_MUTEX_INITIALIZER 50 PTHREAD_MUTEX_INITIALIZER
51}; 51};
52 52
53#define dtoa_get_threadno pthread_self
54void
55set_max_dtoa_threads(unsigned int n);
56
53#define ACQUIRE_DTOA_LOCK(n) do { \ 57#define ACQUIRE_DTOA_LOCK(n) do { \
54 int r = pthread_mutex_lock(&private_dtoa_lock[n]); \ 58 int r = pthread_mutex_lock(&private_dtoa_lock[n]); \
55 if (r) { \ 59 if (r) { \