mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Merge pull request #9658 from pennae/env-diet
reduce the size of Env by one pointer
This commit is contained in:
commit
83f5622545
9 changed files with 75 additions and 34 deletions
7
doc/manual/rl-next/env-size-reduction.md
Normal file
7
doc/manual/rl-next/env-size-reduction.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
synopsis: Reduce eval memory usage and wall time
|
||||
prs: 9658
|
||||
---
|
||||
|
||||
Reduce the size of the `Env` struct used in the evaluator by a pointer, or 8 bytes on most modern machines.
|
||||
This reduces memory usage during eval by around 2% and wall time by around 3%.
|
31
doc/manual/rl-next/with-error-reporting.md
Normal file
31
doc/manual/rl-next/with-error-reporting.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
synopsis: Better error reporting for `with` expressions
|
||||
prs: 9658
|
||||
---
|
||||
|
||||
`with` expressions using non-attrset values to resolve variables are now reported with proper positions.
|
||||
|
||||
Previously an incorrect `with` expression would report no position at all, making it hard to determine where the error originated:
|
||||
|
||||
```
|
||||
nix-repl> with 1; a
|
||||
error:
|
||||
… <borked>
|
||||
|
||||
at «none»:0: (source not available)
|
||||
|
||||
error: value is an integer while a set was expected
|
||||
```
|
||||
|
||||
Now position information is preserved and reported as with most other errors:
|
||||
|
||||
```
|
||||
nix-repl> with 1; a
|
||||
error:
|
||||
… while evaluating the first subexpression of a with expression
|
||||
at «string»:1:1:
|
||||
1| with 1; a
|
||||
| ^
|
||||
|
||||
error: value is an integer while a set was expected
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue