Fix struct function ordering in c files

This commit is contained in:
Krzosa Karol
2022-06-17 11:46:05 +02:00
parent 218ca7266a
commit a77f0ee8fe
4 changed files with 47 additions and 49 deletions

View File

@@ -2,16 +2,8 @@ Os :: #import "os.kl"
SizeU :: #strict U64
arena_di: U64
ALLOCATOR_ACTION :: enum
ALLOCATE
RESIZE
FREE_ALL
Allocator :: struct
proc: (a: *Allocator, action: ALLOCATOR_ACTION, size: SizeU, old_pointer: *void): *void
Arena :: struct
allocator: Allocator
// allocator: Allocator
di: U64 // @debug_id
memory: Os.Memory
alignment: U64
@@ -59,6 +51,15 @@ arena_push_size :: (a: *Arena, size: SizeU): *void
arena_release :: (a: *Arena)
Os.release(&a.memory)
/*
ALLOCATOR_ACTION :: enum
ALLOCATE
RESIZE
FREE_ALL
Allocator :: struct
proc: (a: *Allocator, action: ALLOCATOR_ACTION, size: SizeU, old_pointer: *void): *void
arena_allocator_proc :: (a: *Allocator, action: ALLOCATOR_ACTION, size: SizeU, old_pointer: *void): *void
arena: *Arena = a->*Arena
if action == ALLOCATOR_ACTION.ALLOCATE
@@ -74,3 +75,4 @@ allocate :: (a: *Allocator, size: SizeU): *void
return a.proc(a, ALLOCATOR_ACTION.ALLOCATE, size, 0)
*/