From ae58502a2112b999919745e291ef0df3f7cb8724 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 30 Aug 2018 12:21:16 +0100 Subject: [PATCH] Make `free_all` built-in --- core/mem/mem.odin | 4 +--- core/runtime/core.odin | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/mem/mem.odin b/core/mem/mem.odin index 283d3e29c..5e7cc6695 100644 --- a/core/mem/mem.odin +++ b/core/mem/mem.odin @@ -1,7 +1,5 @@ package mem -import "core:runtime" - foreign _ { @(link_name = "llvm.bswap.i16") swap16 :: proc(b: u16) -> u16 ---; @(link_name = "llvm.bswap.i32") swap32 :: proc(b: u32) -> u32 ---; @@ -214,7 +212,7 @@ init_arena_from_context :: proc(using a: ^Arena, size: int) { } -context_from_allocator :: proc(a: Allocator) -> runtime.Context { +context_from_allocator :: proc(a: Allocator) -> type_of(context) { c := context; c.allocator = a; return c; diff --git a/core/runtime/core.odin b/core/runtime/core.odin index 24f94f8b3..acb71e7ce 100644 --- a/core/runtime/core.odin +++ b/core/runtime/core.odin @@ -382,6 +382,9 @@ new_clone :: proc[mem.new_clone]; @(builtin) free :: proc[mem.free]; +@(builtin) +free_all :: proc[mem.free_all]; + @(builtin) delete :: proc[ mem.delete_string,