aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-11-15 18:45:40 +0000
committergingerBill <bill@gingerbill.org>2020-11-15 18:45:40 +0000
commit17ec3e72a68b805fc202174722778545c956f433 (patch)
tree65aaebc967965e39712de04c490a9ecbfebe8b47 /src/ir_print.cpp
parent30d922b05938ccde7e49f027e2e65ca28849b218 (diff)
Add SCOPED_TEMPORARY_BLOCK for temporary allocations within a block
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 2d15f176b..1a306365f 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -76,7 +76,8 @@ void ir_write_u64(irFileBuffer *f, u64 i) {
}
void ir_write_big_int(irFileBuffer *f, BigInt const &x, Type *type, bool swap_endian) {
if (x.len == 2) {
- gbAllocator a = heap_allocator(); // TODO(bill): Change this allocator
+ SCOPED_TEMPORARY_BLOCK();
+
u64 words[2] = {};
BigInt y = x;
if (swap_endian) {
@@ -88,9 +89,8 @@ void ir_write_big_int(irFileBuffer *f, BigInt const &x, Type *type, bool swap_en
y.d.words = words;
}
- String s = big_int_to_string(a, &y, 10);
+ String s = big_int_to_string(temporary_allocator(), &y, 10);
ir_write_string(f, s);
- gb_free(a, s.text);
} else {
i64 i = 0;
if (x.neg) {