Merge pull request #2819 from BrzVlad/fix-major-log
[mono.git] / mono / utils / lock-free-array-queue.c
index fd069a640e32739d44e42c8319c2acc2bb10b769..b0d0a9a1dfe593ab67005f1cb52e960b0d89447b 100644 (file)
@@ -3,6 +3,7 @@
  * require hazard pointers.
  *
  * (C) Copyright 2011 Xamarin Inc.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 /*
  * entry data, and then sets the state to USED or FREE.
  */
 
+#include <string.h>
+
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-membar.h>
+#ifdef SGEN_WITHOUT_MONO
+#include <mono/sgen/sgen-gc.h>
+#include <mono/sgen/sgen-client.h>
+#else
 #include <mono/utils/mono-mmap.h>
+#endif
 
 #include <mono/utils/lock-free-array-queue.h>
 
@@ -37,7 +45,7 @@ alloc_chunk (MonoLockFreeArray *arr)
 {
        int size = mono_pagesize ();
        int num_entries = (size - (sizeof (Chunk) - arr->entry_size * MONO_ZERO_LEN_ARRAY)) / arr->entry_size;
-       Chunk *chunk = (Chunk *) mono_valloc (0, size, MONO_MMAP_READ | MONO_MMAP_WRITE);
+       Chunk *chunk = (Chunk *) mono_valloc (NULL, size, MONO_MMAP_READ | MONO_MMAP_WRITE);
        g_assert (chunk);
        chunk->num_entries = num_entries;
        return chunk;