Skip to content

Commit

Permalink
maybe_vec
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jul 19, 2024
1 parent 85f158b commit 468e6ed
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/swc_compiler_base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use once_cell::sync::Lazy;
use rustc_hash::FxHashMap;
#[allow(unused)]
use serde::{Deserialize, Serialize};
use swc_allocator::maybe::vec::Vec;
use swc_atoms::JsWord;
use swc_common::{
collections::AHashMap,
Expand Down
4 changes: 4 additions & 0 deletions crates/swc_ecma_codegen/benches/bench.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
extern crate swc_malloc;

use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Bencher, Criterion};
use swc_allocator::{maybe::vec::Vec, Allocator};
use swc_common::FileName;
use swc_ecma_codegen::Emitter;
use swc_ecma_parser::{Parser, StringInput, Syntax};
Expand Down Expand Up @@ -94,6 +95,9 @@ fn bench_emitter(b: &mut Bencher, s: &str) {
}

b.iter(|| {
let alloc = Allocator::default();
let mut _guard = unsafe { alloc.guard() };

let mut src_map_buf = Vec::new();
let mut buf = Vec::new();
{
Expand Down
1 change: 1 addition & 0 deletions crates/swc_ecma_codegen/benches/with_parse.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
extern crate swc_malloc;

use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Bencher, Criterion};
use swc_allocator::maybe::vec::Vec;
use swc_common::FileName;
use swc_ecma_codegen::Emitter;
use swc_ecma_parser::{Parser, StringInput, Syntax};
Expand Down
1 change: 1 addition & 0 deletions crates/swc_ecma_codegen/examples/sourcemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::{
time::Instant,
};

use swc_allocator::maybe::vec::Vec;
use swc_common::input::SourceFileInput;
use swc_ecma_ast::*;
use swc_ecma_codegen::{text_writer::JsWriter, Emitter};
Expand Down
1 change: 1 addition & 0 deletions crates/swc_ecma_codegen/src/text_writer/basic_impl.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::io::Write;

use rustc_hash::FxHashSet;
use swc_allocator::maybe::vec::Vec;
use swc_common::{sync::Lrc, BytePos, LineCol, SourceMap, Span};

use super::{Result, WriteJs};
Expand Down
1 change: 1 addition & 0 deletions crates/swc_ecma_codegen/tests/sourcemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::{fs::read_to_string, path::PathBuf};
use base64::prelude::{Engine, BASE64_STANDARD};
use rustc_hash::FxHashSet;
use sourcemap::SourceMap;
use swc_allocator::maybe::vec::Vec;
use swc_common::{comments::SingleThreadedComments, source_map::SourceMapGenConfig};
use swc_ecma_ast::EsVersion;
use swc_ecma_codegen::{text_writer::WriteJs, Emitter};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use swc_allocator::maybe::vec::Vec;
use swc_common::{comments::SingleThreadedComments, sync::Lrc, FileName, Mark, SourceMap};
use swc_ecma_codegen::{text_writer::JsWriter, Emitter};
use swc_ecma_parser::{Parser, StringInput};
Expand Down
1 change: 1 addition & 0 deletions crates/swc_fast_ts_strip/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::{cell::RefCell, rc::Rc};

use anyhow::{Context, Error};
use serde::{Deserialize, Serialize};
use swc_allocator::maybe::vec::Vec;
use swc_common::{
comments::SingleThreadedComments,
errors::{Handler, HANDLER},
Expand Down

0 comments on commit 468e6ed

Please sign in to comment.