diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-25 22:31:30 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-25 22:31:30 +0100 |
| commit | 3ab481df17d35ac0ac66f0bb619885e43dc060f1 (patch) | |
| tree | a5c7a17498c4e369adcaddb187bb03549f8a48e1 /code/demo.odin | |
| parent | 4e7150b470fe9a0b0794fa9bdbac49ffc2c113be (diff) | |
`new` as a user-level procedure
Diffstat (limited to 'code/demo.odin')
| -rw-r--r-- | code/demo.odin | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/code/demo.odin b/code/demo.odin index cda53e35b..d14de8f90 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -4,11 +4,7 @@ import ( proc main() { - proc new_type(T: type) -> ^T { - return ^T(alloc(size_of(T), align_of(T))); - } - - var ptr = new_type(int); + var ptr = new(int); ptr^ = 123; fmt.println(ptr^); |