[sgen] Fix binary protocol.
authorMark Probst <mark.probst@gmail.com>
Wed, 28 Jul 2010 14:01:54 +0000 (16:01 +0200)
committerMark Probst <mark.probst@gmail.com>
Wed, 4 Aug 2010 01:56:11 +0000 (03:56 +0200)
The major collector refactoring left the binary protocol broken.  Fix
it.

mono/metadata/sgen-gc.c
mono/metadata/sgen-protocol.c
mono/metadata/sgen-protocol.h

index 384277276e50d45011ed0fd46429e3ed84ce3609..c04c697a5f126ddf9044fae89385a0f3fc1c473d 100644 (file)
@@ -4388,7 +4388,7 @@ update_current_thread_stack (void *start)
  */
 //#define XDOMAIN_CHECKS_IN_WBARRIER
 
-#ifndef BINARY_PROTOCOL
+#ifndef SGEN_BINARY_PROTOCOL
 #ifndef HEAVY_STATISTICS
 #define MANAGED_ALLOCATION
 #ifndef XDOMAIN_CHECKS_IN_WBARRIER
@@ -5904,7 +5904,7 @@ check_consistency (void)
 
        DEBUG (1, fprintf (gc_debug_file, "Heap consistency check done.\n"));
 
-#ifdef BINARY_PROTOCOL
+#ifdef SGEN_BINARY_PROTOCOL
        if (!binary_protocol_file)
 #endif
                g_assert (!missing_remsets);
@@ -6329,7 +6329,7 @@ mono_gc_base_init (void)
                                heap_dump_file = fopen (filename, "w");
                                if (heap_dump_file)
                                        fprintf (heap_dump_file, "<sgen-dump>\n");
-#ifdef BINARY_PROTOCOL
+#ifdef SGEN_BINARY_PROTOCOL
                        } else if (g_str_has_prefix (opt, "binary-protocol=")) {
                                char *filename = strchr (opt, '=') + 1;
                                binary_protocol_file = fopen (filename, "w");
index 9387e61dd98ab30cba79f62cb0eb55933ce83973..c60ccfba9a649e5b9542b6e6c667c1837118e317 100644 (file)
@@ -52,7 +52,7 @@ binary_protocol_flush_buffers_rec (BinaryProtocolBuffer *buffer)
        g_assert (buffer->index > 0);
        fwrite (buffer->buffer, 1, buffer->index, binary_protocol_file);
 
-       free_os_memory (buffer, sizeof (BinaryProtocolBuffer));
+       mono_sgen_free_os_memory (buffer, sizeof (BinaryProtocolBuffer));
 }
 
 static void
@@ -75,12 +75,12 @@ binary_protocol_get_buffer (int length)
        if (buffer && buffer->index + length <= BINARY_PROTOCOL_BUFFER_SIZE)
                return buffer;
 
-       new_buffer = get_os_memory (sizeof (BinaryProtocolBuffer), TRUE);
+       new_buffer = mono_sgen_alloc_os_memory (sizeof (BinaryProtocolBuffer), TRUE);
        new_buffer->next = buffer;
        new_buffer->index = 0;
 
        if (InterlockedCompareExchangePointer ((void**)&binary_protocol_buffers, new_buffer, buffer) != buffer) {
-               free_os_memory (new_buffer, sizeof (BinaryProtocolBuffer));
+               mono_sgen_free_os_memory (new_buffer, sizeof (BinaryProtocolBuffer));
                goto retry;
        }
 
index 0b7db6c9c2894c9819165f53469e114c9892c93b..6842d76430637b33f05e59034021b99a9508a6f5 100644 (file)
@@ -126,7 +126,6 @@ typedef struct {
 
 /* missing: finalizers, dislinks, roots, non-store wbarriers */
 
-void binary_protocol_flush_buffers (void) MONO_INTERNAL;
 void binary_protocol_collection (int generation) MONO_INTERNAL;
 void binary_protocol_alloc (gpointer obj, gpointer vtable, int size) MONO_INTERNAL;
 void binary_protocol_alloc_pinned (gpointer obj, gpointer vtable, int size) MONO_INTERNAL;