From 62a72f0163b2f35ca11cd8f4bbb4c7de2c66fca4 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 30 Jul 2017 14:52:42 +0100 Subject: `transmute(type)x`; Minor code clean up --- src/build_settings.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/build_settings.cpp') diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 3f5530da4..4b5ffdc64 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -160,6 +160,7 @@ String odin_root_dir(void) { } array_init_count(&path_buf, heap_allocator(), 300); + defer (array_free(&path_buf)); len = 0; for (;;) { @@ -179,7 +180,10 @@ String odin_root_dir(void) { tmp = gb_temp_arena_memory_begin(&string_buffer_arena); + defer (gb_temp_arena_memory_end(tmp)); + text = gb_alloc_array(string_buffer_allocator, u8, len + 1); + gb_memmove(text, &path_buf[0], len); path = make_string(text, len); @@ -194,10 +198,6 @@ String odin_root_dir(void) { global_module_path = path; global_module_path_set = true; - gb_temp_arena_memory_end(tmp); - - array_free(&path_buf); - return path; } #endif @@ -267,7 +267,7 @@ String get_fullpath_core(gbAllocator a, String path) { } -String const ODIN_VERSION = str_lit("0.6.0-dev"); +String const ODIN_VERSION = str_lit("0.6.0"); void init_build_context(void) { BuildContext *bc = &build_context; -- cgit v1.2.3