feat(tvix/eval): nonrecursive deep_force()
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>
This commit is contained in:
parent
c956138ee6
commit
3701379745
5 changed files with 83 additions and 81 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue