Fix old_demos; Fix when bug; Fix enum .names

This commit is contained in:
Ginger Bill
2017-09-29 21:11:16 +01:00
parent 793bc8c585
commit 11614c2649
13 changed files with 285 additions and 286 deletions
+9 -9
View File
@@ -1,14 +1,14 @@
#import "fmt.odin";
#import "utf8.odin";
#import "hash.odin";
#import "mem.odin";
import "core:fmt.odin";
import "core:utf8.odin";
import "core:hash.odin";
import "core:mem.odin";
main :: proc() {
{ // New Standard Library stuff
s := "Hello";
fmt.println(s,
utf8.valid_string(s),
hash.murmur64(cast([]byte)s));
hash.murmur64(cast([]u8)s));
// utf8.odin
// hash.odin
@@ -20,10 +20,10 @@ main :: proc() {
{
arena: mem.Arena;
mem.init_arena_from_context(^arena, mem.megabytes(16)); // Uses default allocator
defer mem.free_arena(^arena);
mem.init_arena_from_context(&arena, mem.megabytes(16)); // Uses default allocator
defer mem.destroy_arena(&arena);
push_allocator mem.arena_allocator(^arena) {
push_allocator mem.arena_allocator(&arena) {
x := new(int);
x^ = 1337;
@@ -49,7 +49,7 @@ main :: proc() {
// You can also "push" a context
c := context; // Create copy of the allocator
c.allocator = mem.arena_allocator(^arena);
c.allocator = mem.arena_allocator(&arena);
push_context c {
x := new(int);