First set of licensing changes
[mono.git] / mono / metadata / mempool.c
index 7747ce23863f64bfba00e5b3f69872575436467a..60d36ae2ad1765d76cbf450dbb8feb9b616bf479 100644 (file)
@@ -10,6 +10,7 @@
  * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
  * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
  * Copyright 2011 Xamarin Inc. (http://www.xamarin.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 #include <config.h>
@@ -107,7 +108,7 @@ mono_mempool_new_size (int initial_size)
                initial_size = MONO_MEMPOOL_MINSIZE;
 #endif
 
-       pool = g_malloc (initial_size);
+       pool = (MonoMemPool *)g_malloc (initial_size);
 
        pool->next = NULL;
        pool->pos = (guint8*)pool + SIZEOF_MEM_POOL; // Start after header
@@ -277,7 +278,7 @@ mono_mempool_alloc (MonoMemPool *pool, guint size)
                // (In individual allocation mode, the constant will be 0 and this path will always be taken)
                if (size >= MONO_MEMPOOL_PREFER_INDIVIDUAL_ALLOCATION_SIZE) {
                        guint new_size = SIZEOF_MEM_POOL + size;
-                       MonoMemPool *np = g_malloc (new_size);
+                       MonoMemPool *np = (MonoMemPool *)g_malloc (new_size);
 
                        np->next = pool->next;
                        np->size = new_size;
@@ -289,7 +290,7 @@ mono_mempool_alloc (MonoMemPool *pool, guint size)
                } else {
                        // Notice: any unused memory at the end of the old head becomes simply abandoned in this case until the mempool is freed (see Bugzilla #35136)
                        guint new_size = get_next_size (pool, size);
-                       MonoMemPool *np = g_malloc (new_size);
+                       MonoMemPool *np = (MonoMemPool *)g_malloc (new_size);
 
                        np->next = pool->next;
                        np->size = new_size;
@@ -373,7 +374,7 @@ mono_mempool_strdup (MonoMemPool *pool,
                return NULL;
 
        l = strlen (s);
-       res = mono_mempool_alloc (pool, l + 1);
+       res = (char *)mono_mempool_alloc (pool, l + 1);
        memcpy (res, s, l + 1);
 
        return res;