feat(tvix/eval): Box Value::Catchable
This is now the only enum variant for Value that is larger than 8 bytes (it's 16 bytes), so boxing it (especially since it's not perf-critical) allows us to get the Value size down to only 16 bytes! Change-Id: I98598e2b762944448bef982e8ff7da6d6683c4aa Reviewed-on: https://cl.tvl.fyi/c/depot/+/10798 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz> Autosubmit: aspen <root@gws.fyi>
This commit is contained in:
parent
dd26177319
commit
7e286aab1a
11 changed files with 45 additions and 40 deletions
|
|
@ -33,7 +33,7 @@ mod impure_builtins {
|
|||
#[builtin("pathExists")]
|
||||
async fn builtin_path_exists(co: GenCo, path: Value) -> Result<Value, ErrorKind> {
|
||||
match coerce_value_to_path(&co, path).await? {
|
||||
Err(cek) => Ok(Value::Catchable(cek)),
|
||||
Err(cek) => Ok(Value::from(cek)),
|
||||
Ok(path) => Ok(generators::request_path_exists(&co, path).await),
|
||||
}
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ mod impure_builtins {
|
|||
#[builtin("readDir")]
|
||||
async fn builtin_read_dir(co: GenCo, path: Value) -> Result<Value, ErrorKind> {
|
||||
match coerce_value_to_path(&co, path).await? {
|
||||
Err(cek) => Ok(Value::Catchable(cek)),
|
||||
Err(cek) => Ok(Value::from(cek)),
|
||||
Ok(path) => {
|
||||
let dir = generators::request_read_dir(&co, path).await;
|
||||
let res = dir.into_iter().map(|(name, ftype)| {
|
||||
|
|
@ -67,7 +67,7 @@ mod impure_builtins {
|
|||
#[builtin("readFile")]
|
||||
async fn builtin_read_file(co: GenCo, path: Value) -> Result<Value, ErrorKind> {
|
||||
match coerce_value_to_path(&co, path).await? {
|
||||
Err(cek) => Ok(Value::Catchable(cek)),
|
||||
Err(cek) => Ok(Value::from(cek)),
|
||||
Ok(path) => Ok(generators::request_read_to_string(&co, path).await),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue