about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/value.hh (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-08-17 r/1657 refactor(tvix): add explicit copy/move constructors for ValueKane York1-0/+7
This is in preparation for making some of Value's members into refcounted ('smart') pointers. Change-Id: Ibc54e23ac35766a2fd4e14871c9a7c936a603778 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1743 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-08-14 r/1646 refactor(tvix): completely remove boehm gcKane York1-13/+8
We have decided that leaking memory is a better fate than random, non-debuggable memory corruption. Future CLs will begin changing various fields to std::unique_ptr and std::shared_ptr. It turns out that disabling the GC does not have disasterous impact. The Nix evaluator only runs on the client CLI, never in any long- running process. Even the REPL does not leak too badly under this change, because it uses one EvalState for the duration of the REPL. Building an explicitly tracing garbage collector is likely in the future of this project, but that giant amount of work cannot be done under a nix evaluator that is constantly crashing. We need to restore development velocity here, and this is the best way we've figured out to do it. Change-Id: I2fcda8fcee853c15a9a5e22eca7c5a784bc2bf76 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1720 Reviewed-by: glittershark <grfn@gws.fyi> Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2020-08-13 r/1642 refactor(tvix): Very minor lint fixesVincent Ambo1-2/+2
Change-Id: I4aca504d98c79f931b7faadff86f40d27ed5a2c5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1719 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-08-09 r/1624 fix(tvix): Make nix value structs inherit from GCGriffin Smith1-5/+5
All of the miscellanious structs that make up a nix Value should inherit from gc, as they contain pointers to GC'ed things as members Fixes: #42 Change-Id: I057d8c9f7dafbee7de7644ff152c9cba1aa6bc03 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1696 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-08-01 r/1528 fix(3p/nix/libexpr): fix GC tracing in valueSizeKane York1-1/+1
Change-Id: I2f6bef7b090d44f50bd27fbd19b50f9cf100b238 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1506 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi> Reviewed-by: tazjin <mail@tazj.in>
2020-08-01 r/1527 feat(3p/nix): remove External values featureKane York1-52/+1
External values are only useful when using the plugin framework, which we are not interested in carrying forward. Reverts commit 320659b0cd161249c95e736c3fb309b1a73ea728 Change-Id: Ib4929c349bbb33f16224fc674e94c7b7d5953c6a Reviewed-on: https://cl.tvl.fyi/c/depot/+/1505 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi> Reviewed-by: tazjin <mail@tazj.in>
2020-07-18 r/1377 refactor(3p/nix/libexpr): Back Nix lists with std::vectorVincent Ambo1-26/+11
This change does away with the previous special-casing of lists of certain element sizes, and the use of raw C-style arrays. Lists are now backed by a std::vector of nix::Value*, which uses the traceable GC allocator. This change is unfortunately quite noisy because the accessor methods were updated/removed accordingly, so all callsites of Nix-related lists have changed. For some operations in primops.cc where keeping the previous code structure would have been more difficult with a "proper" vector, the implementation has been replaced with std::vector methods. For example, list concatenation now uses appropriate range inserts. Anecdotally the performance of this is about equal, to even slightly better, than the previous implementation. All language tests pass and the depot paths I've used for testing still evaluate. Change-Id: Ib5eca6c0207429cb323a330c838c3a2200b2c693 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1266 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi> Reviewed-by: Kane York <rikingcoding@gmail.com> Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-17 r/1354 feat(3p/nix): Add function to allocate a Value in traceable memoryEelco Dolstra1-0/+2
Backported from: https://github.com/NixOS/nix/commit/b3e5eea4a91400fb2a12aba4b07a94d03ba54605 https://github.com/NixOS/nix/commit/fcd048a526bd239fa615457e77d61d69d679bf03 Intentionally skipped because we have not backported the JSON changes: https://github.com/NixOS/nix/commit/9f46f54de4e55267df492456fc0393f74616366b Did not apply changes ni primops.cc, because those look suspect and are also based on something that we don't have in our tree. Change-Id: I837787ce9f2c90267bc39fce15177980d209d4e9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1253 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi>
2020-07-17 r/1353 fix(3p/nix): ValueMap, VectorVector: Use traceable_allocatorEelco Dolstra1-2/+2
We want to *trace* the 'Value *' arrays, not garbage-collect them! Otherwise the vectors/maps can end up pointing to nowhere. Backported from: https://github.com/NixOS/nix/commit/10e17eaa5802a3c368eee8408821828072e76ba7 Change-Id: I30dc94caa80c9d982e7a14bc67ba2d065e8203aa Reviewed-on: https://cl.tvl.fyi/c/depot/+/1252 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi>
2020-05-27 r/865 refactor(3p/nix): Anchor local includes at src/Vincent Ambo1-5/+3
Previously all includes were anchored in one global mess of header files. This moves the includes into filesystem "namespaces" (if you will) for each sub-package of Nix. Note: This commit does not introduce the relevant build system changes.
2020-05-23 r/820 chore(3p/nix/libexpr): Minor readability improvements in eval/valueVincent Ambo1-5/+0
2020-05-21 r/797 refactor(3p/nix/libexpr): Use std::string as qualified typeVincent Ambo1-5/+6
Replaces most uses of `string` with `std::string`. This came up because I removed the "types.hh" import from "symbol-table.hh", which percolated through a bunch of files where `string` was suddenly no longer defined ... *sigh*
2020-05-19 r/770 fix(3p/nix/libexpr): Declare value union types explicitlyVincent Ambo1-43/+59
Previously these structs were declared anonymously inside of the - anonymous - union. This is not actually supported by the C++ standard, but is merely a compiler-specific extension. Unfortunately untangling this required a forward-declaration of the Value type.
2020-05-17 r/740 style(3p/nix): Reformat project in Google C++ styleVincent Ambo1-207/+173
Reformatted with: fd . -e hh -e cc | xargs clang-format -i
2020-05-17 r/724 Add 'third_party/nix/' from commit 'be66c7a6b24e3c3c6157fd37b86c7203d14acf10'Vincent Ambo1-0/+274
git-subtree-dir: third_party/nix git-subtree-mainline: cf8cd640c1adf74a3706efbcb0ea4625da106fb2 git-subtree-split: be66c7a6b24e3c3c6157fd37b86c7203d14acf10