From 73b7bd92e5c9b7f03aee11808fdcb72f95348d72 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 12 Apr 2021 12:31:20 +0200 Subject: [PATCH] core: remove some unnecessary heap allocations --- core/runtime.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/core/runtime.rs b/core/runtime.rs index 4174e05985..98bcc018a2 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -155,19 +155,18 @@ fn v8_init(v8_platform: Option>) { v8::V8::initialize_platform(v8_platform); v8::V8::initialize(); - let argv = vec![ - "".to_string(), - "--wasm-test-streaming".to_string(), + let flags = concat!( + "--wasm-test-streaming", // TODO(ry) This makes WASM compile synchronously. Eventually we should // remove this to make it work asynchronously too. But that requires getting // PumpMessageLoop and RunMicrotasks setup correctly. // See https://github.com/denoland/deno/issues/2544 - "--no-wasm-async-compilation".to_string(), - "--harmony-top-level-await".to_string(), - "--harmony-import-assertions".to_string(), - "--no-validate-asm".to_string(), - ]; - v8::V8::set_flags_from_command_line(argv); + " --no-wasm-async-compilation", + " --harmony-top-level-await", + " --harmony-import-assertions", + " --no-validate-asm", + ); + v8::V8::set_flags_from_string(flags); } #[derive(Default)]