diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-07-30 14:52:42 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-07-30 14:52:42 +0100 |
| commit | 62a72f0163b2f35ca11cd8f4bbb4c7de2c66fca4 (patch) | |
| tree | e334be658d8ed4018e8ae8bb37334dbc1834f14c /src/build_settings.cpp | |
| parent | 655931f0ea282f8dbaa769a213311a774e4f84c6 (diff) | |
`transmute(type)x`; Minor code clean up
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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; |