aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-11-01 14:28:27 -0400
committerGitHub <noreply@github.com>2021-11-01 14:28:27 -0400
commit77eefebe65fc2baed08755bceb8e4df77fe8103c (patch)
tree7c6d967f3f9973c3a40c1cceab5ec1d54b238c93 /src/Module.zig
parent002fbb0af043d90b0ab7d2f2804effc6fa2d690c (diff)
parenta34375814106dbc0e0181bca7cc4ffb1821cb51e (diff)
downloadzig-77eefebe65fc2baed08755bceb8e4df77fe8103c.tar.gz
zig-77eefebe65fc2baed08755bceb8e4df77fe8103c.zip
Merge pull request #10077 from squeek502/arraylist-capacity
std.ArrayList: add ensureTotalCapacityPrecise and update doc comments
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 1f394a0833..c975fc1c36 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -4146,7 +4146,7 @@ pub fn analyzeFnBody(mod: *Module, decl: *Decl, func: *Fn, arena: *Allocator) Se
// for the runtime ones.
const fn_ty = decl.ty;
const runtime_params_len = @intCast(u32, fn_ty.fnParamLen());
- try inner_block.instructions.ensureTotalCapacity(gpa, runtime_params_len);
+ try inner_block.instructions.ensureTotalCapacityPrecise(gpa, runtime_params_len);
try sema.air_instructions.ensureUnusedCapacity(gpa, fn_info.total_params_len * 2); // * 2 for the `addType`
try sema.inst_map.ensureUnusedCapacity(gpa, fn_info.total_params_len);