# std.ArrayList: mark the appendNTimes methods inline · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/57ea6207d3cb2db706bdc06c14605e4b901736dd)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 57ea6207d3cb2db706bdc06c14605e4b901736dd

Requested commit: 57ea6207d3cb2db706bdc06c14605e4b901736dd

Commit: 57ea6207d3cb2db706bdc06c14605e4b901736dd

Tree: e40302ce7199f5614d8b9c3cc9a3d70c782620ce

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.ArrayList: mark the appendNTimes methods inline

The previous commit introduced an optimization to the LLVM backend that
makes `@memset` lower more optimally when the element is comptime-known
and has a repeating byte pattern.

By making these functions inline, if the element parameter is
comptime-known at the callsite, it will be comptime-known in the
`@memset` call, causing more use of the LLVM `memset` intrinsic rather
than an inline for loop when using the LLVM backend.

This affects, for example, std.crypto.argon2, which calls
appendNTimesAssumeCapacity with a `[128]u64` as the element. This is now
lowered with a single `memset` call.

```

## Parents

- [82fc360613e7070ffe7124fb070b151a382bd31b](https://git.cafe/gitcafe/zig/commit/82fc360613e7070ffe7124fb070b151a382bd31b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/57ea6207d3cb2db706bdc06c14605e4b901736dd?format=markdown)
