Skip to content
Closed
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
2 changes: 2 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ jobs:
env:
CARGO_PROFILE_RELEASE_STRIP: 'true'
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: '1'
# jemalloc fixes its page size at build time; 64 KiB pages also run on 4 and 16 KiB kernels.
JEMALLOC_SYS_WITH_LG_PAGE: '16'
run: cargo build --release --bin flow_cli
- name: Create artifacts
run: |-
Expand Down
21 changes: 21 additions & 0 deletions rust_port/Cargo.lock

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

3 changes: 3 additions & 0 deletions rust_port/crates/flow_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,8 @@ lsp-types = "0.97"
serde = { version = "1.0.229", features = ["derive", "rc"] }
serde_json = { version = "1.0.154", features = ["alloc", "float_roundtrip", "raw_value", "unbounded_depth"] }

[target.'cfg(target_os = "linux")'.dependencies]
tikv-jemallocator = { version = "0.7.0", features = ["background_threads"] }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(fbcode_build)"]}
6 changes: 6 additions & 0 deletions rust_port/crates/flow_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
#[used]
static malloc_conf: &str = "metadata_thp:always\0";

// Buck builds pick their allocator with `fbcode.default_allocator`, which replaces `malloc` for the
// whole binary, so a Rust global allocator there could link a second copy of jemalloc.
#[cfg(all(not(fbcode_build), target_os = "linux"))]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

fn main() {
#[cfg(windows)]
{
Expand Down
Loading