Skip to content

Commit 7f46d79

Browse files
geeknoidMartin TailleferCopilot
authored
feat(multitude): Introduce Alloc<T> and reintroduce Rc<T> (#521)
- Arenas no longer return simple references (&mut T), then now instead return `Alloc<T>`. This makes it so these allocated objects can be dropped promptly instead of at chunk retirement. This in turn makes it possible for the T being allocated to not needing to be `Send`. And it simplifies the internal logic by eliminating the complexities around deferred drop logic. - Now that underlying implementations issues have been addressed, reintroduce Rc<T>. - Shave a few instructions from some arena allocation functions. Co-authored-by: Martin Taillefer <mataille@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7e40d96 commit 7f46d79

82 files changed

Lines changed: 12598 additions & 9990 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.spelling

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
5xx
1212
=
13+
>=
1314
ABA
1415
ABI
1516
ACLs
@@ -317,6 +318,7 @@ end_offset
317318
entry_offset
318319
enum
319320
enums
321+
escapable
320322
evaluator
321323
ffi
322324
fhl-scus4-app-win
@@ -527,6 +529,7 @@ submodules
527529
substring
528530
subtrait
529531
sudo
532+
superset
530533
supertrait
531534
supertraits
532535
sys

Cargo.lock

Lines changed: 20 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fundle_macros = { path = "crates/fundle_macros", default-features = false, versi
7373
fundle_macros_impl = { path = "crates/fundle_macros_impl", default-features = false, version = "0.3.3" }
7474
http_extensions = { path = "crates/http_extensions", default-features = false, version = "0.6.3" }
7575
layered = { path = "crates/layered", default-features = false, version = "0.3.4" }
76-
multitude = { path = "crates/multitude", default-features = false, version = "0.4.1" }
76+
multitude = { path = "crates/multitude", default-features = false, version = "0.5.0" }
7777
ohno = { path = "crates/ohno", default-features = false, version = "0.3.7" }
7878
ohno_macros = { path = "crates/ohno_macros", default-features = false, version = "0.3.4" }
7979
recoverable = { path = "crates/recoverable", default-features = false, version = "0.1.6" }
@@ -135,6 +135,7 @@ jiff = { version = "0.2.21", default-features = false }
135135
libc = { version = "0.2.178", default-features = false }
136136
loom = { version = "0.7.2", default-features = false }
137137
many_cpus = { version = "2.1.0", default-features = false }
138+
mimalloc = { version = "0.1.52", default-features = false }
138139
mockall = { version = "0.14.0", default-features = false }
139140
moka = { version = "0.12.14", default-features = false }
140141
mutants = { version = "0.0.3", default-features = false }

crates/multitude/Cargo.toml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[package]
55
name = "multitude"
6-
version = "0.4.1"
6+
version = "0.5.0"
77
description = "Fast and flexible arena allocator."
88
readme = "README.md"
99
keywords = ["arena", "memory", "allocator", "bump"]
@@ -77,6 +77,7 @@ bolero = { workspace = true, features = ["std"] }
7777
# but does not itself activate that feature on `bolero-engine`.
7878
bumpalo = { workspace = true, features = ["collections"] }
7979
criterion = { workspace = true }
80+
mimalloc = { workspace = true }
8081
mutants = { workspace = true }
8182
serde_json = { workspace = true }
8283

@@ -104,6 +105,14 @@ harness = false
104105
name = "criterion_arc_array"
105106
harness = false
106107

108+
[[bench]]
109+
name = "criterion_rc_array"
110+
harness = false
111+
112+
[[bench]]
113+
name = "criterion_arena_vs_allocator"
114+
harness = false
115+
107116
# Callgrind benches require Linux (Valgrind). The bench files are gated to compile
108117
# to a no-op on non-Linux targets, but the [[bench]] entry itself cannot be
109118
# cfg-gated, so it is unconditional here.
@@ -119,6 +128,10 @@ harness = false
119128
name = "gungraun_arc_array"
120129
harness = false
121130

131+
[[bench]]
132+
name = "gungraun_rc_array"
133+
harness = false
134+
122135
[[example]]
123136
name = "multitude_basic"
124137

0 commit comments

Comments
 (0)