nix-super/src/libexpr/primops
Eelco Dolstra fecff520d7 Add a ListBuilder helper for constructing list values
Previously, `state.mkList()` would set the type of the value to tList
and allocate the list vector, but it would not initialize the values
in the list. This has two problems:

* If an exception occurs, the list is left in an undefined state.

* More importantly, for multithreaded evaluation, if a value
  transitions from thunk to non-thunk, it should be final (i.e. other
  threads should be able to access the value safely).

To address this, there now is a `ListBuilder` class (analogous to
`BindingsBuilder`) to build the list vector prior to the call to
`Value::mkList()`. Typical usage:

   auto list = state.buildList(size);
   for (auto & v : list)
       v = ... set value ...;
   vRes.mkList(list);
2024-03-15 18:26:37 +01:00
..
context.cc Add a ListBuilder helper for constructing list values 2024-03-15 18:26:37 +01:00
derivation.nix Remove corepkgs/derivation.nix 2020-09-17 09:41:02 +02:00
fetchClosure.cc Rename hintfmt to HintFmt 2024-02-08 11:58:25 -08:00
fetchMercurial.cc Fetcher cleanups 2024-03-04 22:24:55 +01:00
fetchTree.cc Fetcher cleanups 2024-03-04 22:24:55 +01:00
fromTOML.cc Add a ListBuilder helper for constructing list values 2024-03-15 18:26:37 +01:00