Skip to content

Commit

Permalink
Merge branch 'master' into fix-wasm-node-crashes-with-xxhash
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Oct 15, 2023
2 parents 9ad519c + d8b31a2 commit f516c43
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 4 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# rollup changelog

## 4.1.1

_2023-10-15_

### Bug Fixes

- Improve Node parsing performance (#5201)

### Pull Requests

- [#5201](https://github.com/rollup/rollup/pull/5201): perf: use mimalloc for bindings_napi (@sapphi-red)

## 4.1.0

_2023-10-14_
Expand Down
2 changes: 1 addition & 1 deletion browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/browser",
"version": "4.1.0",
"version": "4.1.1",
"description": "Next-generation ES module bundler browser build",
"main": "dist/rollup.browser.js",
"module": "dist/es/rollup.browser.js",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup",
"version": "4.1.0",
"version": "4.1.1",
"description": "Next-generation ES module bundler",
"main": "dist/rollup.js",
"module": "dist/es/rollup.js",
Expand Down
27 changes: 27 additions & 0 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions rust/bindings_napi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ napi-derive = "2.13.0"
parse_ast = { path = "../parse_ast" }
xxhash = { path = "../xxhash" }

[target.'cfg(not(target_os = "linux"))'.dependencies]
mimalloc-rust = { version = "0.2" }

[target.'cfg(all(target_os = "linux", not(all(target_env = "musl", target_arch = "aarch64"))))'.dependencies]
mimalloc-rust = { version = "0.2", features = ["local-dynamic-tls"] }

[build-dependencies]
napi-build = "2.0.1"
7 changes: 7 additions & 0 deletions rust/bindings_napi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ use napi::bindgen_prelude::*;
use napi_derive::napi;
use parse_ast::parse_ast;

#[cfg(all(
not(all(target_os = "linux", target_env = "musl", target_arch = "aarch64")),
not(debug_assertions)
))]
#[global_allocator]
static ALLOC: mimalloc_rust::GlobalMiMalloc = mimalloc_rust::GlobalMiMalloc;

#[napi]
pub fn parse(code: String, allow_return_outside_function: bool) -> Buffer {
parse_ast(code, allow_return_outside_function).into()
Expand Down

0 comments on commit f516c43

Please sign in to comment.