diff --git a/lib/std/collections/hashmap.c3 b/lib/std/collections/hashmap.c3 index 62bedc105..77d4e0e39 100644 --- a/lib/std/collections/hashmap.c3 +++ b/lib/std/collections/hashmap.c3 @@ -316,11 +316,11 @@ fn Key[] HashMap.copy_keys(&map, Allocator allocator = allocator::heap()) { while (entry) { - $if COPY_KEYS: - list[index++] = entry.key.copy(allocator); - $else + //$if COPY_KEYS: + // list[index++] = entry.key.copy(allocator); + //$else list[index++] = entry.key; - $endif + //$endif entry = entry.next; } } @@ -419,9 +419,9 @@ fn HashMapKeyIterator HashMap.key_iter(&self) fn void HashMap.add_entry(&map, uint hash, Key key, Value value, uint bucket_index) @private { - $if COPY_KEYS: - key = key.copy(map.allocator); - $endif + //$if COPY_KEYS: + //key = key.copy(map.allocator); + //$endif Entry* entry = allocator::new(map.allocator, Entry, { .hash = hash, .key = key, .value = value, .next = map.table[bucket_index] }); map.table[bucket_index] = entry; if (map.count++ >= map.threshold) @@ -531,9 +531,9 @@ fn bool HashMap.remove_entry_for_key(&map, Key key) @private fn void HashMap.create_entry(&map, uint hash, Key key, Value value, int bucket_index) @private { Entry *e = map.table[bucket_index]; - $if COPY_KEYS: - key = key.copy(map.allocator); - $endif + //$if COPY_KEYS: + //key = key.copy(map.allocator); + //$endif Entry* entry = allocator::new(map.allocator, Entry, { .hash = hash, .key = key, .value = value, .next = map.table[bucket_index] }); map.table[bucket_index] = entry; map.count++; @@ -541,9 +541,9 @@ fn void HashMap.create_entry(&map, uint hash, Key key, Value value, int bucket_i fn void HashMap.free_entry(&self, Entry *entry) @local { - $if COPY_KEYS: - allocator::free(self.allocator, entry.key); - $endif + //$if COPY_KEYS: + //allocator::free(self.allocator, entry.key); + //$endif self.free_internal(entry); } diff --git a/lib/std/encoding/json.c3 b/lib/std/encoding/json.c3 index 894e175e8..fd86ec82d 100644 --- a/lib/std/encoding/json.c3 +++ b/lib/std/encoding/json.c3 @@ -171,7 +171,7 @@ fn Object*! parse_map(JsonContext* context) @local temp_key.append(string); parse_expected(context, COLON)!; Object* element = parse_any(context)!; - map.set(temp_key.str_view(), element); + map.set(temp_key.copy_str(context.allocator), element); token = advance(context)!; if (token == JsonTokenType.COMMA) { diff --git a/releasenotes.md b/releasenotes.md index a9ab4056e..6c6fd5855 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -17,6 +17,7 @@ - Improve error message when using ',' in struct declarations. #1920 - Compile time array assign ops, e.g. `$c[1] += 3` #1890. - Add `inline` to enums #1819. +- Add flag `--no-run`. For commands which may run executable after building, skip the run step. #1931 ### Fixes - Fix issue requiring prefix on a generic interface declaration. diff --git a/src/build/build.h b/src/build/build.h index f774c74b6..fb74cd0b5 100644 --- a/src/build/build.h +++ b/src/build/build.h @@ -552,6 +552,7 @@ typedef struct BuildOptions_ bool print_output; bool print_input; bool run_once; + bool no_run; int verbosity_level; const char *panicfn; const char *benchfn; diff --git a/src/build/build_options.c b/src/build/build_options.c index f122e2885..1fe4b2594 100644 --- a/src/build/build_options.c +++ b/src/build/build_options.c @@ -102,6 +102,7 @@ static void usage(bool full) print_opt("--template