Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit fdfe8dd

Browse files
committed
Improve documentation of static_array_backend feature
1 parent 260432b commit fdfe8dd

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
110110
runtime overhead. It is useful when debugging a use-after-free or `wee_alloc`
111111
itself.
112112

113+
- **static_array_backend**: Force the use of an OS-independent fixed-size (16 MB)
114+
backing implementation. Suitable for deploying to non-WASM/Unix/Windows
115+
`#![no_std]` environments, such as on embedded devices with esoteric or effectively
116+
absent operating systems.
117+
113118
### Implementation Notes and Constraints
114119

115120
- `wee_alloc` imposes two words of overhead on each allocation for maintaining

wee_alloc/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
authors = ["Nick Fitzgerald <fitzgen@gmail.com>"]
3-
categories = ["memory-management", "web-programming", "no-std", "wasm"]
3+
categories = ["memory-management", "web-programming", "no-std", "wasm", "embedded"]
44
description = "wee_alloc: The Wasm-Enabled, Elfin Allocator"
55
license = "MPL-2.0"
66
name = "wee_alloc"
@@ -20,11 +20,12 @@ extra_assertions = []
2020
# Enable size classes for amortized *O(1)* small allocations.
2121
size_classes = []
2222

23+
# Enable fixed-sized, OS-independent backing memory implementation
24+
static_array_backend = []
25+
2326
# This is for internal use only.
2427
use_std_for_test_debugging = []
2528

26-
static_array_backend = []
27-
2829
[dependencies]
2930
memory_units = "0.4.0"
3031
cfg-if = "0.1.2"

wee_alloc/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
110110
runtime overhead. It is useful when debugging a use-after-free or `wee_alloc`
111111
itself.
112112
113+
- **static_array_backend**: Force the use of an OS-independent fixed-size (16 MB)
114+
backing implementation. Suitable for deploying to non-WASM/Unix/Windows
115+
`#![no_std]` environments, such as on embedded devices with esoteric or effectively
116+
absent operating systems.
117+
113118
## Implementation Notes and Constraints
114119
115120
- `wee_alloc` imposes two words of overhead on each allocation for maintaining

0 commit comments

Comments
 (0)