new as a user-level procedure

This commit is contained in:
Ginger Bill
2017-06-25 22:31:30 +01:00
parent 4e7150b470
commit 3ab481df17
5 changed files with 13 additions and 8 deletions
+5
View File
@@ -264,6 +264,11 @@ proc resize(ptr: rawptr, old_size, new_size: int, alignment: int = DEFAULT_ALIGN
}
proc new(T: type) -> ^T {
return ^T(alloc(size_of(T), align_of(T)));
}
proc default_resize_align(old_memory: rawptr, old_size, new_size, alignment: int) -> rawptr {
if old_memory == nil {