# std.Progress: smaller type for parents and robustify · gitcafe/zig

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

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

Visibility: public

Requested revision: ea7d8ec14752575a68733742be2ee7a583eea49e

Requested commit: ea7d8ec14752575a68733742be2ee7a583eea49e

Commit: ea7d8ec14752575a68733742be2ee7a583eea49e

Tree: 0d46205cd1eecde8fa29f1729fe2ebf6d45f7392

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.Progress: smaller type for parents and robustify

Switch Node.Parent, Node.Index, and Node.OptionalIndex to be backed by
u8 rather than u16. This works fine since we use 200 as the preallocated
node buffer. This has the nice property that scanning the entire parents
array for allocated nodes fits in 4 cache lines, even if we bumped the
200 up to 254 (leaving room for the two special states).

The thread that reads progress updates from the pipe now handles short
reads by ignoring messages that are sent in multiple reads.

When checking the terminal size, if there is a failure, fall back to a
conservative guess of 80x25 rather than panicking. A debug message is
also emitted which would be displayed only in a debug build.

```

## Parents

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

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