# std.crypto.25519.field: avoid excessive inlining · gitcafe/zig

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

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

Visibility: public

Requested revision: a71d00a4d504edfdb09cd169d29ca1bbc0b909c4

Requested commit: a71d00a4d504edfdb09cd169d29ca1bbc0b909c4

Commit: a71d00a4d504edfdb09cd169d29ca1bbc0b909c4

Tree: 1b4f5a419ee46ccc26d605f00109f026d9a40c26

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.crypto.25519.field: avoid excessive inlining

This valid zig code produces reasonable LLVM IR, however, on the
wasm32-wasi target, when using the wasmtime runtime, the number of
locals of the `isSquare` function exceeds 50000, causing wasmtime
to refuse to execute the binary.

The `inline` keyword in Zig is intended to be used only where it is
semantically necessary; not as an optimization hint. Otherwise, this may
produce unwanted binary bloat for the -OReleaseSmall use case.

In the future, it is possible that we may end up with both `inline`
keyword, which operates as it does in status quo, and additionally
`callconv(.inline_hint)` which has no semantic impact, but may be
observed by optimization passes.

In this commit, I also cleaned up `isSquare` by eliminating an
unnecessary mutable variable, replacing it with several local constants.

Closes #11947.

```

## Parents

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

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