# debug: fix resource \(de\)allocation for Elf and Coff targets · gitcafe/zig

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

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

Visibility: public

Requested revision: 28ca203b7132ba0513a3854bd3bcbd0ee9bca067

Requested commit: 28ca203b7132ba0513a3854bd3bcbd0ee9bca067

Commit: 28ca203b7132ba0513a3854bd3bcbd0ee9bca067

Tree: eabc9d3522d89fe8d050197bd6dc1c8a14c349a5

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
debug: fix resource (de)allocation for Elf and Coff targets

With this change, it is now possible to safely call
`var di = std.debug.openSelfDebugInfo(gpa)`. Calling then
`di.deinit()` on the object will correctly free all allocated
resources.

Ensure we store the result of `mmap` with correct alignment.

```

## Parents

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

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