RUNTIME: AllocArrayInstance and AllocInstance return ArrayHeader * and ObjHeader * respectively

This commit is contained in:
Vasily Levchenko
2016-11-29 18:38:51 +03:00
committed by vvlevchenko
parent d4fda3bfe2
commit b62536f807
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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();
+2 -2
View File
@@ -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
}