# std lib: modify allocator idiom · gitcafe/zig

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

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

Visibility: public

Requested revision: a2bd9f8912ade5149855dc6e2371aaae49093660

Requested commit: a2bd9f8912ade5149855dc6e2371aaae49093660

Commit: a2bd9f8912ade5149855dc6e2371aaae49093660

Tree: 04dab23f1d6d730b5266506422daf820124fa139

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std lib: modify allocator idiom

Before we accepted a nullable allocator for some stuff like
opening files. Now we require an allocator.

Use the mem.FixedBufferAllocator pattern if a bound on the amount
to allocate is known.

This also establishes the pattern that usually an allocator is the
first argument to a function (possibly after "self").

fix docs for std.cstr.addNullByte

self hosted compiler:
 * only build docs when explicitly asked to
 * clean up main
 * stub out zig fmt

```

## Parents

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

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