From b62536f8078da51f1bb5b4ebf061d94d43851844 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Tue, 29 Nov 2016 18:38:51 +0300 Subject: [PATCH] RUNTIME: AllocArrayInstance and AllocInstance return ArrayHeader * and ObjHeader * respectively --- runtime/src/main/cpp/Memory.cpp | 4 ++-- runtime/src/main/cpp/Memory.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/src/main/cpp/Memory.cpp b/runtime/src/main/cpp/Memory.cpp index 17d5e245fbe..f51d4f22b6b 100644 --- a/runtime/src/main/cpp/Memory.cpp +++ b/runtime/src/main/cpp/Memory.cpp @@ -76,12 +76,12 @@ void InitMemory() { } // Now we ignore all placement hints and always allocate heap space for new object. -void* AllocInstance(const TypeInfo* type_info, PlacementHint hint) { +ObjHeader* AllocInstance(const TypeInfo* type_info, PlacementHint hint) { RuntimeAssert(type_info->instanceSize_ >= 0, "must be an object"); return ObjectContainer(type_info).GetPlace(); } -void* AllocArrayInstance( +ArrayHeader* AllocArrayInstance( const TypeInfo* type_info, PlacementHint hint, uint32_t elements) { RuntimeAssert(type_info->instanceSize_ < 0, "must be an array"); return ArrayContainer(type_info, elements).GetPlace(); diff --git a/runtime/src/main/cpp/Memory.h b/runtime/src/main/cpp/Memory.h index cdc3aeaf87f..21d85c44af2 100644 --- a/runtime/src/main/cpp/Memory.h +++ b/runtime/src/main/cpp/Memory.h @@ -263,8 +263,8 @@ extern "C" { #endif void InitMemory(); -void* AllocInstance(const TypeInfo* type_info, PlacementHint hint); -void* AllocArrayInstance( +ObjHeader* AllocInstance(const TypeInfo* type_info, PlacementHint hint); +ArrayHeader* AllocArrayInstance( const TypeInfo* type_info, PlacementHint hint, uint32_t elements); #ifdef __cplusplus }