# macho: don't allocate Dylib on the heap · gitcafe/zig

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

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

Visibility: public

Requested revision: 0b15ba8334bc03b59a975e579aac01a6b3fc2109

Requested commit: 0b15ba8334bc03b59a975e579aac01a6b3fc2109

Commit: 0b15ba8334bc03b59a975e579aac01a6b3fc2109

Tree: 267ab3306af2b4277b933770de1d3fd696260372

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
macho: don't allocate Dylib on the heap

instead, immediately transfer ownership to MachO struct. Also, revert
back to try-ok-fail parsing approach of objects, archives, and dylibs.
It seems easier to try and fail than check if the file *is* of a
certain type given that a dylib may be a stub and parsing yaml
twice in a row seems very wasteful.

Hint for the future: if we optimise yaml/TAPI parsing, this approach
may be rethought!

```

## Parents

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

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