* src/mm/boehm-gc/include/private/gcconfig.h: Added __sun, since sun
[cacao.git] / src / mm / boehm.c
index c4f6a18b8ce2e56ac4973f538a52061845d16073..411cb6c70d9e5d6aa2ff3f0ceb1374c9e9875619 100644 (file)
@@ -1,9 +1,7 @@
 /* src/mm/boehm.c - interface for boehm gc
 
-   Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
-   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
-   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
-   J. Wenninger, Institut f. Computersprachen - TU Wien
+   Copyright (C) 1996-2005, 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
@@ -26,7 +24,8 @@
 
 
 #include "config.h"
-#include "vm/types.h"
+
+#include <stdint.h>
 
 #if defined(ENABLE_THREADS) && defined(__LINUX__)
 #define GC_LINUX_THREADS
@@ -34,6 +33,9 @@
 #if defined(ENABLE_THREADS) && defined(__IRIX__)
 #define GC_IRIX_THREADS
 #endif
+#if defined(ENABLE_THREADS) && defined(__DARWIN__)
+#define GC_DARWIN_THREADS
+#endif
 
 #include "boehm-gc/include/gc.h"
 #include "mm/gc-common.h"
@@ -69,10 +71,12 @@ static void gc_ignore_warnings(char *msg, GC_word arg);
 
 *******************************************************************************/
 
-void gc_init(u4 heapmaxsize, u4 heapstartsize)
+void gc_init(size_t heapmaxsize, size_t heapstartsize)
 {
        size_t heapcurrentsize;
 
+       TRACESUBSYSTEMINITIALIZATION("gc_init");
+
        /* just to be sure (should be set to 1 by JAVA_FINALIZATION macro) */
 
        GC_java_finalization = 1;
@@ -114,7 +118,7 @@ static void gc_ignore_warnings(char *msg, GC_word arg)
 }
 
 
-void *heap_alloc_uncollectable(u4 size)
+void *heap_alloc_uncollectable(size_t size)
 {
        void *p;
 
@@ -122,7 +126,7 @@ void *heap_alloc_uncollectable(u4 size)
 
        /* clear allocated memory region */
 
-       MSET(p, 0, u1, size);
+       MSET(p, 0, uint8_t, size);
 
        return p;
 }
@@ -134,7 +138,7 @@ void *heap_alloc_uncollectable(u4 size)
 
 *******************************************************************************/
 
-void *heap_alloc(u4 size, u4 references, methodinfo *finalizer, bool collect)
+void *heap_alloc(size_t size, int references, methodinfo *finalizer, bool collect)
 {
        void *p;
 #if defined(ENABLE_RT_TIMING)
@@ -159,7 +163,7 @@ void *heap_alloc(u4 size, u4 references, methodinfo *finalizer, bool collect)
 
        /* clear allocated memory region */
 
-       MSET(p, 0, u1, size);
+       MSET(p, 0, uint8_t, size);
 
        RT_TIMING_GET_TIME(time_end);
        RT_TIMING_TIME_DIFF(time_start, time_end, RT_TIMING_GC_ALLOC);
@@ -183,13 +187,13 @@ void gc_call(void)
 }
 
 
-s8 gc_get_heap_size(void)
+int64_t gc_get_heap_size(void)
 {
        return GC_get_heap_size();
 }
 
 
-s8 gc_get_free_bytes(void)
+int64_t gc_get_free_bytes(void)
 {
        return GC_get_free_bytes();
 }
@@ -201,13 +205,13 @@ s8 gc_get_free_bytes(void)
 
 *******************************************************************************/
 
-s8 gc_get_total_bytes(void)
+int64_t gc_get_total_bytes(void)
 {
        return GC_get_total_bytes();
 }
 
 
-s8 gc_get_max_heap_size(void)
+int64_t gc_get_max_heap_size(void)
 {
        return GC_get_max_heap_size();
 }