# macho: use target arch page_size for codesig · gitcafe/zig

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

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

Visibility: public

Requested revision: 2faf8c53d226cec1445156cafdec59af5e909fb2

Requested commit: 2faf8c53d226cec1445156cafdec59af5e909fb2

Commit: 2faf8c53d226cec1445156cafdec59af5e909fb2

Tree: 1b177f07c11e52e99fc569bd217b754c6db7151e

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
macho: use target arch page_size for codesig

It turns out I was wrong and we can set the page size to the actual
page size used by the target architecture when dividing the binary
into chunks and calculating a hash of each chunk for embedding within
the adhoc code signature. This shaves of a considerable amount of bytes
since we divide the code signature section by at least 2x.

I've also unified the `write` interface of `CodeSignature` struct to
follow that used in every other bit of `MachO`; namely, the functions
now accept a writer instead of a buffer, therefore, there is no need
to manually track where to write each struct field anymore.

```

## Parents

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

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