2010-05-14 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mono / utils / strtod.c
index f20c28f9c382e9f5cc1d10cfbcd65c241d69a51b..71d1f08b9d1265c2bc71cce2d9807ed613cb083e 100644 (file)
 #define freedtoa __freedtoa
 #define dtoa __dtoa
 
-G_LOCK_DEFINE_STATIC(str_mutex0);
-G_LOCK_DEFINE_STATIC(str_mutex1);
+#define Omit_Private_Memory
 #define MULTIPLE_THREADS 1
-#define ACQUIRE_DTOA_LOCK(n)   G_LOCK (str_mutex##n)
-#define FREE_DTOA_LOCK(n)              G_UNLOCK (str_mutex##n)
+/* Lock 0 is not used because of USE_MALLOC, Lock 1 protects a lazy-initialized table */
+#define ACQUIRE_DTOA_LOCK(n)
+#define FREE_DTOA_LOCK(n)
 
 /* Please send bug reports to David M. Gay (dmg at acm dot org,
  * with " at " changed at "@" and " dot " changed to ".").     */
@@ -565,13 +565,17 @@ Bfree
        (Bigint *v)
 #endif
 {
+#ifdef Omit_Private_Memory
+       free (v);
+#else
        if (v) {
                ACQUIRE_DTOA_LOCK(0);
                v->next = freelist[v->k];
                freelist[v->k] = v;
                FREE_DTOA_LOCK(0);
-               }
        }
+#endif
+}
 
 #define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \
 y->wds*sizeof(Long) + 2*sizeof(int))