diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-05-13 21:42:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-13 19:42:34 +0000 |
commit | 226a373c497cc3439e032332fefaffa75211afbd (patch) | |
tree | 75d368b29d8d3e409721b2fd15758e918068bac7 /cli/util/v8.rs | |
parent | cf6f965e2506a24d345bd8b1d8c20390f3f246fa (diff) |
fix(lsp): increase default max heap size to 3Gb (#19115)
Diffstat (limited to 'cli/util/v8.rs')
-rw-r--r-- | cli/util/v8.rs | 15 |
1 files changed, 12 insertions, 3 deletions
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<String> { #[inline(always)] pub fn construct_v8_flags( + default_v8_flags: &[String], v8_flags: &[String], env_v8_flags: Vec<String>, ) -> Vec<String> { 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::<Vec<_>>() } -pub fn init_v8_flags(v8_flags: &[String], env_v8_flags: Vec<String>) { - 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<String>, +) { + 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<String>) { .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) |