From 226a373c497cc3439e032332fefaffa75211afbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 13 May 2023 21:42:34 +0200 Subject: fix(lsp): increase default max heap size to 3Gb (#19115) --- cli/util/v8.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'cli/util') diff --git a/cli/util/v8.rs b/cli/util/v8.rs index 6afaf285e..93a2ef83f 100644 --- a/cli/util/v8.rs +++ b/cli/util/v8.rs @@ -10,17 +10,26 @@ pub fn get_v8_flags_from_env() -> Vec { #[inline(always)] pub fn construct_v8_flags( + default_v8_flags: &[String], v8_flags: &[String], env_v8_flags: Vec, ) -> Vec { std::iter::once("UNUSED_BUT_NECESSARY_ARG0".to_owned()) + .chain(default_v8_flags.iter().cloned()) .chain(env_v8_flags.into_iter()) .chain(v8_flags.iter().cloned()) .collect::>() } -pub fn init_v8_flags(v8_flags: &[String], env_v8_flags: Vec) { - if v8_flags.is_empty() && env_v8_flags.is_empty() { +pub fn init_v8_flags( + default_v8_flags: &[String], + v8_flags: &[String], + env_v8_flags: Vec, +) { + if default_v8_flags.is_empty() + && v8_flags.is_empty() + && env_v8_flags.is_empty() + { return; } @@ -29,7 +38,7 @@ pub fn init_v8_flags(v8_flags: &[String], env_v8_flags: Vec) { .chain(v8_flags) .any(|flag| flag == "-help" || flag == "--help"); // Keep in sync with `standalone.rs`. - let v8_flags = construct_v8_flags(v8_flags, env_v8_flags); + let v8_flags = construct_v8_flags(default_v8_flags, v8_flags, env_v8_flags); let unrecognized_v8_flags = deno_core::v8_set_flags(v8_flags) .into_iter() .skip(1) -- cgit v1.2.3