Change push allocator system; update core libraries

This commit is contained in:
gingerBill
2017-11-09 22:48:00 +00:00
parent dbb070524f
commit eb4b3f5976
12 changed files with 162 additions and 177 deletions
+8 -1
View File
@@ -115,9 +115,16 @@ init_arena_from_context :: proc(using a: ^Arena, size: int) {
temp_count = 0;
}
context_from_allocator :: proc(a: Allocator) -> Context {
c := context;
c.allocator = a;
return c;
}
destroy_arena :: proc(using a: ^Arena) {
if backing.procedure != nil {
push_allocator backing {
context <- context_from_allocator(backing) {
free(memory);
memory = nil;
}