Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
Add Comment
Please, Sign In to add comment