Add file listing
This commit is contained in:
@@ -64,7 +64,6 @@ test_type :: ()
|
||||
t51 := get_type_info(t5.base_type)
|
||||
assert(t51.kind == Type_Info_Kind.ARRAY)
|
||||
|
||||
|
||||
t6 := get_type_info(type6)
|
||||
t61 := get_type_info(t6.base_type)
|
||||
t62 := get_type_info(t61.base_type)
|
||||
|
||||
@@ -3,7 +3,6 @@ SizeU :: U64
|
||||
arena_di: U64
|
||||
|
||||
Arena :: struct
|
||||
// allocator: Allocator
|
||||
di: U64 // @debug_id
|
||||
memory: Os.Memory
|
||||
alignment: U64
|
||||
@@ -48,32 +47,19 @@ arena_push_size :: (a: *Arena, size: SizeU): *void
|
||||
a.len += size
|
||||
return result
|
||||
|
||||
// @todo: Make this compile time thing!!!
|
||||
// This probably will wait till polymorphism stuff
|
||||
// something like this:
|
||||
// arena_push_type :: (a: *Arena, type: $T): *T
|
||||
//
|
||||
arena_push_type :: (a: *Arena, type: Type): *void
|
||||
type_info := get_type_info(type)
|
||||
assert(type_info != 0)
|
||||
return arena_push_size(a, type_info.size->SizeU)
|
||||
|
||||
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
|
||||
return arena_push_size(arena, size)
|
||||
elif action == ALLOCATOR_ACTION.RESIZE
|
||||
pass
|
||||
elif action == ALLOCATOR_ACTION.FREE_ALL
|
||||
pass
|
||||
else;; assert(false, "Invalid codepath")
|
||||
return 0
|
||||
|
||||
allocate :: (a: *Allocator, size: SizeU): *void
|
||||
return a.proc(a, ALLOCATOR_ACTION.ALLOCATE, size, 0)
|
||||
*/
|
||||
|
||||
//
|
||||
// Unicode
|
||||
|
||||
@@ -139,6 +139,8 @@ WinMain :: (hInstance: HINSTANCE, hPrevInstance: HINSTANCE, lpCmdLine: LPSTR, nS
|
||||
good_scheduling = true
|
||||
|
||||
arena: Arena
|
||||
|
||||
data: *int = arena_push_type(&arena, int)
|
||||
window_name := string_to_string16(&arena, "Have a wonderful day! 豈 更 車 賈 滑 串 句 龜 ")
|
||||
w := WNDCLASSW{
|
||||
lpfnWndProc = window_procedure,
|
||||
|
||||
Reference in New Issue
Block a user