Created
July 18, 2010 14:15
-
-
Save od0x0/480433 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import memory/Allocator | |
printf: extern func(String,...)->Int | |
Vec3: class{ | |
x, y, z: Float | |
init: func(=x,=y,=z){} | |
println: func{ | |
printf("(%f,%f,%f)\n",x,y,z) | |
} | |
} | |
Vec3 setAllocator(Allocator manual) | |
v3:=Vec3 new(1,0,0) | |
v3 println() | |
v3 delete() | |
newString:=Allocator manual allocate(4) as String | |
string:="Yes" | |
for(i in 0..4) newString[i]=string[i] | |
newString println() | |
Allocator manual freeMemory(newString) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment