[sgen] `GCObject*` instead of `void*`
[mono.git] / mono / metadata / sgen-mono.c
index cea42173ae6b3a23a9fd5e466a86e9a869eb7646..936348752203892fa15151ac0f87acb96e290f86 100644 (file)
@@ -1712,7 +1712,7 @@ mono_gc_alloc_vector (MonoVTable *vtable, size_t size, uintptr_t max_length)
 
 #ifndef DISABLE_CRITICAL_REGION
        ENTER_CRITICAL_REGION;
-       arr = sgen_try_alloc_obj_nolock (vtable, size);
+       arr = (MonoArray*)sgen_try_alloc_obj_nolock (vtable, size);
        if (arr) {
                /*This doesn't require fencing since EXIT_CRITICAL_REGION already does it for us*/
                arr->max_length = (mono_array_size_t)max_length;
@@ -1724,7 +1724,7 @@ mono_gc_alloc_vector (MonoVTable *vtable, size_t size, uintptr_t max_length)
 
        LOCK_GC;
 
-       arr = sgen_alloc_obj_nolock (vtable, size);
+       arr = (MonoArray*)sgen_alloc_obj_nolock (vtable, size);
        if (G_UNLIKELY (!arr)) {
                UNLOCK_GC;
                return mono_gc_out_of_memory (size);
@@ -1754,7 +1754,7 @@ mono_gc_alloc_array (MonoVTable *vtable, size_t size, uintptr_t max_length, uint
 
 #ifndef DISABLE_CRITICAL_REGION
        ENTER_CRITICAL_REGION;
-       arr = sgen_try_alloc_obj_nolock (vtable, size);
+       arr = (MonoArray*)sgen_try_alloc_obj_nolock (vtable, size);
        if (arr) {
                /*This doesn't require fencing since EXIT_CRITICAL_REGION already does it for us*/
                arr->max_length = (mono_array_size_t)max_length;
@@ -1769,7 +1769,7 @@ mono_gc_alloc_array (MonoVTable *vtable, size_t size, uintptr_t max_length, uint
 
        LOCK_GC;
 
-       arr = sgen_alloc_obj_nolock (vtable, size);
+       arr = (MonoArray*)sgen_alloc_obj_nolock (vtable, size);
        if (G_UNLIKELY (!arr)) {
                UNLOCK_GC;
                return mono_gc_out_of_memory (size);
@@ -1801,7 +1801,7 @@ mono_gc_alloc_string (MonoVTable *vtable, size_t size, gint32 len)
 
 #ifndef DISABLE_CRITICAL_REGION
        ENTER_CRITICAL_REGION;
-       str = sgen_try_alloc_obj_nolock (vtable, size);
+       str = (MonoString*)sgen_try_alloc_obj_nolock (vtable, size);
        if (str) {
                /*This doesn't require fencing since EXIT_CRITICAL_REGION already does it for us*/
                str->length = len;
@@ -1813,7 +1813,7 @@ mono_gc_alloc_string (MonoVTable *vtable, size_t size, gint32 len)
 
        LOCK_GC;
 
-       str = sgen_alloc_obj_nolock (vtable, size);
+       str = (MonoString*)sgen_alloc_obj_nolock (vtable, size);
        if (G_UNLIKELY (!str)) {
                UNLOCK_GC;
                return mono_gc_out_of_memory (size);