perf: new_string_owned 零拷贝路径替代 new_string 二次克隆

This commit is contained in:
2026-08-13 14:55:08 +08:00
parent d2c21c3a4a
commit 3ad80d6ed4
10 changed files with 42 additions and 37 deletions
+1 -1
View File
@@ -281,7 +281,7 @@ pub fn json_stringify<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
{
return NativeResult::Err(crate::error::create_type_error(vm, "Converting circular structure to JSON"));
};
NativeResult::Ok(vm.new_string(&output))
NativeResult::Ok(vm.new_string_owned(output))
}
#[allow(clippy::too_many_arguments)]