2010-02-04 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Thu, 4 Feb 2010 08:09:02 +0000 (08:09 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:53 +0000 (21:06 +0400)
* mallocx.c (GC_generic_malloc_many, GC_malloc_many): Define even
if THREADS is undefined.
* include/gc.h (GC_malloc_many): Update the comment.

ChangeLog
include/gc.h
mallocx.c

index dc1ab55..42804e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-04  Ivan Maidanski <ivmai@mail.ru>
+
+       * mallocx.c (GC_generic_malloc_many, GC_malloc_many): Define even
+       if THREADS is undefined.
+       * include/gc.h (GC_malloc_many): Update the comment.
+
 2010-02-03  Ivan Maidanski <ivmai@mail.ru>
 
        * ChangeLog: Fix some typos.
index 562ff19..197b6b1 100644 (file)
@@ -1205,7 +1205,6 @@ GC_API void (GC_CALLBACK * GC_is_visible_print_proc)(void *);
 /* This returns a list of objects, linked through their first word.     */
 /* Its use can greatly reduce lock contention problems, since the       */
 /* allocation lock can be acquired and released many fewer times.       */
-/* Exported only if the library has been compiled with threads support. */
 GC_API void * GC_CALL GC_malloc_many(size_t /* lb */);
 #define GC_NEXT(p) (*(void * *)(p))     /* Retrieve the next element    */
                                         /* in returned list.            */
index 99a0336..b27c8b0 100644 (file)
--- a/mallocx.c
+++ b/mallocx.c
@@ -232,8 +232,6 @@ GC_API void GC_CALL GC_incr_bytes_freed(size_t n)
     GC_bytes_freed += n;
 }
 
-#if defined(THREADS)
-
 # ifdef PARALLEL_MARK
     STATIC volatile signed_word GC_bytes_allocd_tmp = 0;
                         /* Number of bytes of memory allocated since    */
@@ -422,19 +420,17 @@ GC_API void GC_CALL GC_generic_malloc_many(size_t lb, int k, void **result)
     (void) GC_clear_stack(0);
 }
 
+/* Note that the "atomic" version of this would be unsafe, since the    */
+/* links would not be seen by the collector.                            */
 GC_API void * GC_CALL GC_malloc_many(size_t lb)
 {
     void *result;
-    GC_generic_malloc_many(((lb + EXTRA_BYTES + GRANULE_BYTES-1)
-                           & ~(GRANULE_BYTES-1)),
+    GC_generic_malloc_many((lb + EXTRA_BYTES + GRANULE_BYTES-1)
+                           & ~(GRANULE_BYTES-1),
                            NORMAL, &result);
     return result;
 }
 
-/* Note that the "atomic" version of this would be unsafe, since the    */
-/* links would not be seen by the collector.                            */
-#endif /* THREADS */
-
 /* Allocate lb bytes of pointerful, traced, but not collectable data */
 GC_API void * GC_CALL GC_malloc_uncollectable(size_t lb)
 {