switch allocations to atomic to improve performance

This commit is contained in:
William Bell
2025-08-20 00:26:35 +01:00
parent 624a54c90c
commit 6ad0b2c02e
2 changed files with 3 additions and 3 deletions

View File

@@ -428,7 +428,7 @@ Translated load_argon_file(char *path, ArErr *err) {
hashmap_free(translated.constants.hashmap, NULL);
Translated gc_translated = {
translated.registerCount, NULL, {}, {}, translated.path};
gc_translated.bytecode.data = ar_alloc(translated.bytecode.capacity);
gc_translated.bytecode.data = ar_alloc_atomic(translated.bytecode.capacity);
memcpy(gc_translated.bytecode.data, translated.bytecode.data,
translated.bytecode.capacity);
gc_translated.bytecode.element_size = translated.bytecode.element_size;
@@ -436,7 +436,7 @@ Translated load_argon_file(char *path, ArErr *err) {
gc_translated.bytecode.resizable = false;
gc_translated.bytecode.capacity =
translated.bytecode.size * translated.bytecode.element_size;
gc_translated.constants.data = ar_alloc(translated.constants.capacity);
gc_translated.constants.data = ar_alloc_atomic(translated.constants.capacity);
memcpy(gc_translated.constants.data, translated.constants.data,
translated.constants.capacity);
gc_translated.constants.size = translated.constants.size;