Change over everything to sizeof intrinsic

This commit is contained in:
Nathan Braswell
2016-04-28 19:22:23 -04:00
parent 2051f54b55
commit 914fc57c13
4 changed files with 5 additions and 16 deletions

View File

@@ -30,19 +30,8 @@ fun free<T>(memPtr: *T): void {
}
}
fun sizeof<T>(): int {
var testObj: *T;
var result: int;
__if_comp__ __C__ {
simple_passthrough(testObj = testObj : result = result:) """
int result = sizeof(*testObj);
"""
}
return result;
}
fun new<T>(count: int): *T {
return malloc<T>( sizeof<T>() * count );
return malloc<T>( #sizeof<T> * count );
}
fun new<T>(): *T {