ladybird/Cargo.toml
Andreas Kling b23aa38546 AK: Adopt mimalloc v2 as main allocator
Use mimalloc for Ladybird-owned allocations without overriding malloc().
Route kmalloc(), kcalloc(), krealloc(), and kfree() through mimalloc,
and put the embedded Rust crates on the same allocator via a shared
shim in AK/kmalloc.cpp.

This also lets us drop kfree_sized(), since it no longer used its size
argument. StringData, Utf16StringData, JS object storage, Rust error
strings, and the CoreAudio playback helpers can all free their AK-backed
storage with plain kfree().

Sanitizer builds still use the system allocator. LeakSanitizer does not
reliably trace references stored in mimalloc-managed AK containers, so
static caches and other long-lived roots can look leaked. Pass the old
size into the Rust realloc shim so aligned fallback reallocations can
move posix_memalign-backed blocks safely.

Static builds still need a little linker help. macOS app binaries need
the Rust allocator entry points forced in from liblagom-ak.a, while
static ELF links can pull in identical allocator shim definitions from
multiple Rust staticlibs. Keep the Apple -u flags and allow those
duplicate shim symbols for LibJS and LibRegex links on Linux and BSD.
2026-04-08 09:57:53 +02:00

35 lines
771 B
TOML

[workspace]
members = [
"Libraries/LibJS/Rust",
"Libraries/LibRegex/Rust",
"Libraries/LibUnicode/Rust",
]
exclude = [
"Libraries/LibJS/AsmIntGen",
]
resolver = "2"
[profile.release]
panic = "abort"
[profile.distribution]
inherits = "release"
incremental = false
codegen-units = 1
lto = true
[workspace.lints.clippy]
all = "deny" # includes lintgroups: correctness, suspicious, style, complexity, perf
# from clippy:nursery:
redundant_clone = "deny"
# from clippy:pedantic:
uninlined_format_args = "deny"
semicolon_if_nothing_returned = "deny"
manual_let_else = "deny"
unnecessary_wraps = "deny"
manual_assert = "deny"
ref_option = "deny"
elidable_lifetime_names = "deny"
unnested_or_patterns = "deny"
borrow_as_ptr = "deny"
explicit_iter_loop = "deny"