aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorTetralux <tetralux@teknik.io>2020-01-03 10:40:45 +0000
committerTetralux <tetralux@teknik.io>2020-01-03 10:40:45 +0000
commitb32ef9e47be90a49010246359475130718dd0af8 (patch)
tree4767723d6d6de0ae78cf6c57206551d483ff48ac /src/ir_print.cpp
parentb8324b0776d0d8d653e44c9f7876d01509b60e77 (diff)
Fix make and reserve
- Set the allocator, even if memory allocation fails. Right now it doesn't, which means that if allocation fails, it'll use the context allocator instead. This memory will be leaked if the user doesn't understand that this happened. - Only set len and cap of the array returned from make iif the memory allocation succeeded. This means that reserve will return false if you do this: ``` a := make([dynamic]int, failing_allocator); if !reserve(&a, 5) do return; // or whatever indicates failure ```
Diffstat (limited to 'src/ir_print.cpp')
0 files changed, 0 insertions, 0 deletions