demo.odin 377 B

123456789101112131415161718192021222324252627
  1. #import "fmt.odin"
  2. #import "os.odin"
  3. #import "mem.odin"
  4. main :: proc() {
  5. x :: proc() -> (int, int) {
  6. return 1, 2
  7. }
  8. y :: proc() -> (int, int) {
  9. return x()
  10. }
  11. fmt.println(y())
  12. arena: mem.Arena
  13. mem.init_arena_from_context(^arena, 1000)
  14. defer mem.free_arena(^arena)
  15. push_allocator mem.arena_allocator(^arena) {
  16. x := new(int)
  17. x^ = 1337
  18. fmt.println(x^)
  19. }
  20. }