Merge pull request #2721 from ludovic-henry/fix-mono_ms_ticks
[mono.git] / mono / profiler / utils.c
index 8bf57a72f7c10e0e68e48ef63215d79e455a1a1c..753024dcf72963e30c7ebef03da79e54b7cdc7e0 100644 (file)
@@ -12,6 +12,7 @@
  *   Paolo Molaro (lupus@ximian.com)
  *
  * Copyright 2010 Novell, Inc (http://www.novell.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 #include "utils.h"
 #include <stdlib.h>
@@ -275,7 +276,7 @@ alloc_buffer (int size)
        return ptr;
 #else
        ptr = mmap (NULL, size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
-       if (ptr == (void*)-1)
+       if (ptr == MAP_FAILED)
                return NULL;
        return ptr;
 #endif