# byos: Ease \`GeneralPurposeAllocator\` integration · gitcafe/zig

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

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

Visibility: public

Requested revision: fd43baa9ad37217a5715c1e3cfad2d2d78558d1f

Requested commit: fd43baa9ad37217a5715c1e3cfad2d2d78558d1f

Commit: fd43baa9ad37217a5715c1e3cfad2d2d78558d1f

Tree: c0d75d8a8c92038f05ea78f961b5dd7b23e0efbc

Author: Jay Petacat

Committer: Andrew Kelley

## Message

```
byos: Ease `GeneralPurposeAllocator` integration

These changes enable me to use `GeneralPurposeAllocator` with my "Bring
Your Own OS" package. The previous checks for a freestanding target have
been expanded to `@hasDecl` checks.

- `root.os.heap.page_allocator` is used if it exists.
- `debug.isValidMemory` only calls `os.msync` if it's supported.

```

## Parents

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

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