Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@ rustflags = "-C link-args=-Wl,--stack,8000000"

[target.wasm32-unknown-unknown]
rustflags = ["--cfg=getrandom_backend=\"wasm_js\""]

[target.wasm32-wasip1]
rustflags = [
"-C", "link-arg=--max-memory=67108864",
"-C", "link-arg=-zstack-size=1048576",
]

[target.wasm32-wasip2]
rustflags = [
"-C", "link-arg=--max-memory=67108864",
"-C", "link-arg=-zstack-size=1048576",
]
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ opt-level = 3
[profile.release]
lto = "thin"

[profile.wasm-release]
inherits = "release"
opt-level = "s"
lto = true
codegen-units = 1
strip = true
panic = "abort"

[patch.crates-io]
parking_lot_core = { git = "https://github.com/youknowone/parking_lot", branch = "rustpython" }
# REDOX START, Uncomment when you want to compile/check with redoxer
Expand Down
4 changes: 4 additions & 0 deletions crates/vm/src/datastack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ use core::alloc::Layout;
use core::ptr;

/// Minimum chunk size in bytes (`_PY_DATA_STACK_CHUNK_SIZE`).
/// Smaller on WASM to reduce initial memory footprint.
#[cfg(target_arch = "wasm32")]
const MIN_CHUNK_SIZE: usize = 4 * 1024;
#[cfg(not(target_arch = "wasm32"))]
const MIN_CHUNK_SIZE: usize = 16 * 1024;

/// Extra headroom (in bytes) to avoid allocating a new chunk for the next
Expand Down
Loading