SIGN IN SIGN UP
oven-sh / bun UNCLAIMED

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one

0 0 150 Rust

bun_alloc: delete unused MimallocHeapRef, TypedArena, BumpWithFallback (#31542)

Dead-code sweep of `bun_alloc`. None referenced outside their own
definitions.

`cargo check --workspace` passes.

## Why this code exists

| Item | Zig original | Zig callers | Status |
|---|---|---|---|
| `MimallocHeapRef` | none (0 hits in `*.zig`) | n/a | **Rust-port
artifact** — speculative `Allocator` impl over raw `*mut mi_heap_t`,
added in 9532c8403b; superseded by `ArenaPtr`, never referenced outside
`src/bun_alloc/` |
| `TypedArena<T>` | none (0 hits for `typed_arena`/`TypedArena` in
`*.zig`) | n/a | **Rust-port artifact** — re-export of
`typed_arena::Arena` added in 76a508931e, never referenced |
| `BumpWithFallback` | none | n/a | **Rust-port artifact** — was the
original struct name in 9532c8403b, renamed to `StackFallback` in
4075846085 leaving this "back-compat alias"; no external caller ever
existed |
| `StackFallback::fallback_mut` | none — Zig
`std.heap.StackFallbackAllocator` exposes `fallback_allocator` as a
public *field* (e.g. `src/js_printer/renamer.zig:496,532`), no method
accessor | n/a | **Rust-port artifact** — Rust-idiom getter (fields are
private in the Rust port); the immutable `fallback()` is used, this
`&mut` variant never was |
| `init_default<T>` | `src/bun_alloc/memory.zig:36` (`initDefault`) | 15
— e.g. `src/ptr/owned.zig:58,64,111,147`, `src/ptr/shared.zig:100`,
`src/collections/array_list.zig:70,81,165`,
`src/threading/guarded.zig:19` | Rust callers were rewritten to plain
`T::default()` over 1f86fa622b / 87d8efd791 / 98ba4b19e6 / 21daace12c;
the wrapper is now identity |
| `MaybeOwned::into_parent` | `src/bun_alloc/maybe_owned.zig:76`
(`intoParent`) | 0 external — only called internally by `deinit` at
`:48` | **dead in Zig too** (public but only self-consumed) |
D
Dylan Conway committed
a3e0d1f7d329f6ef51456852976799d464f9e2eb
Parent: f46fe89
Committed by GitHub <noreply@github.com> on 5/29/2026, 1:48:59 AM