diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-12-11T09·04-0800 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-12-12T14·36+0000 |
commit | 370137974526ef9af1f0d3496d17e4232e3babfe (patch) | |
tree | 338546dc311f221db73e191953dfb1af2ddb2d60 /tvix/eval/src/builtins | |
parent | c956138ee6c158c12f5c5eb3568aea1b0aea7494 (diff) |
feat(tvix/eval): nonrecursive deep_force() r/7175
This commit implements deep_force() nonrecursively, by maintaining an explicit stack rather than using the call stack for recursion. As an added bonus, we don't need to pass around the SharedThunkSet anymore, and can in fact completely eliminate SharedThunkSet. Change-Id: I7c4f59f37834d451a28bf6be317eb0a90eac4ee6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10252 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: Adam Joseph <adam@westernsemico.com>
Diffstat (limited to 'tvix/eval/src/builtins')
-rw-r--r-- | tvix/eval/src/builtins/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 09b341886c59..5f99704e63c3 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -19,7 +19,7 @@ use crate::warnings::WarningKind; use crate::{ self as tvix_eval, errors::{CatchableErrorKind, ErrorKind}, - value::{CoercionKind, NixAttrs, NixList, NixString, SharedThunkSet, Thunk, Value}, + value::{CoercionKind, NixAttrs, NixList, NixString, Thunk, Value}, }; use self::versions::{VersionPart, VersionPartsIter}; @@ -236,7 +236,7 @@ mod pure_builtins { #[builtin("deepSeq")] async fn builtin_deep_seq(co: GenCo, x: Value, y: Value) -> Result<Value, ErrorKind> { - generators::request_deep_force(&co, x, SharedThunkSet::default()).await; + generators::request_deep_force(&co, x).await; Ok(y) } @@ -983,7 +983,7 @@ mod pure_builtins { #[builtin("toXML")] async fn builtin_to_xml(co: GenCo, value: Value) -> Result<Value, ErrorKind> { - let value = generators::request_deep_force(&co, value, SharedThunkSet::default()).await; + let value = generators::request_deep_force(&co, value).await; let mut buf: Vec<u8> = vec![]; to_xml::value_to_xml(&mut buf, &value)?; Ok(String::from_utf8(buf)?.into()) |