2007-12-21 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / libgc / misc.c
index 5b10feeb961faa9badb793eae3b4659ed24cab5c..be2555b8f2da054cf61bdf50cc367bc5ef16e9dc 100644 (file)
@@ -246,7 +246,7 @@ void *arg2;
        byte_sz = WORDS_TO_BYTES(word_sz);
        if (GC_all_interior_pointers) {
            /* We need one extra byte; don't fill in GC_size_map[byte_sz] */
-           byte_sz--;
+           byte_sz -= EXTRA_BYTES;
        }
 
        for (j = low_limit; j <= byte_sz; j++) GC_size_map[j] = word_sz;  
@@ -477,7 +477,7 @@ void GC_init()
 #if defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS)
     if (!GC_is_initialized) {
       BOOL (WINAPI *pfn) (LPCRITICAL_SECTION, DWORD) = NULL;
-      HMODULE hK32 = GetModuleHandle("kernel32.dll");
+      HMODULE hK32 = GetModuleHandle(_T("kernel32.dll"));
       if (hK32)
           (FARPROC) pfn = GetProcAddress(hK32,
                          "InitializeCriticalSectionAndSpinCount");
@@ -804,7 +804,10 @@ void GC_init_inner()
 
 void GC_enable_incremental GC_PROTO(())
 {
-# if !defined(SMALL_CONFIG)
+# if !defined(SMALL_CONFIG) && !defined(KEEP_BACK_PTRS)
+  /* If we are keeping back pointers, the GC itself dirties all        */
+  /* pages on which objects have been marked, making           */
+  /* incremental GC pointless.                                 */
   if (!GC_find_leak) {
     DCL_LOCK_STATE;