mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-01 20:28:15 +00:00
new as a user-level procedure
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user