Skip to content

Commit

Permalink
Merge branch 'develop' into change_arena_end_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenmeker authored Dec 7, 2024
2 parents a36e28f + dd25f06 commit f871d8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/codegen/EmitConfigParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ static std::pair<llvm::Value *, llvm::BasicBlock *> get_eval(
auto *malloc = create_malloc(
creator.get_current_block(),
llvm::ConstantExpr::getSizeOf(result->getType()),
get_or_insert_function(mod, "malloc", ptr_ty, ptr_ty));
get_or_insert_function(mod, "kore_alloc_always_gc", ptr_ty, ptr_ty));
new llvm::StoreInst(result, malloc, creator.get_current_block());
retval = malloc;
break;
Expand Down Expand Up @@ -563,7 +563,8 @@ static void emit_get_token(kore_definition *definition, llvm::Module *module) {
case_block);
auto *malloc = create_malloc(
case_block, llvm::ConstantExpr::getSizeOf(compare->getType()),
get_or_insert_function(module, "malloc", ptr_ty, ptr_ty));
get_or_insert_function(
module, "kore_alloc_always_gc", ptr_ty, ptr_ty));
new llvm::StoreInst(compare, malloc, case_block);
phi->addIncoming(malloc, case_block);
llvm::BranchInst::Create(merge_block, case_block);
Expand Down
2 changes: 1 addition & 1 deletion runtime/util/ConfigurationParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void *get_mint_token(size_t size, char const *c_str) {
std::string precision_str = str.substr(idx + 1);
long long precision = std::stoll(precision_str);
long long precision_in_bytes = (precision + 7) / 8;
char *token = (char *)malloc(precision_in_bytes);
char *token = (char *)kore_alloc_always_gc(precision_in_bytes);
std::string val_str = str.substr(0, idx);
mpz_t z;
mpz_init_set_str(z, val_str.c_str(), 10);
Expand Down

0 comments on commit f871d8c

Please sign in to comment.