# stage1: Change how the Frame alignment is computed · gitcafe/zig

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

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

Visibility: public

Requested revision: 50a8124f45cd0994b52af3fd166dd3bda48f4b99

Requested commit: 50a8124f45cd0994b52af3fd166dd3bda48f4b99

Commit: 50a8124f45cd0994b52af3fd166dd3bda48f4b99

Tree: 1e5c4a6bcd6a9b233f9aa198a07663aa9a9ddb37

Author: LemonBoy

Committer: LemonBoy

## Message

```
stage1: Change how the Frame alignment is computed

The code would previously assume every function would start at addresses
being multiples of 16, this is not true beside some specific cases.
Moreover LLVM picks different alignment values depending on whether it's
trying to generate dense or fast code.

Let's use the minimum guaranteed alignment as base value, computed
according to how big the opcodes are.

The alignment of function pointers is always 1, a safe value that won't
cause any error at runtime. Note that this was already the case before
this commit, here we're making this choice explicit.

Let the 'alignment' field for TypeInfo of fn types reflect the ABI
alignment used by the compiler, make this field behave similarly to the
'alignment' one for pointers.

```

## Parents

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

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