Skip to content

Commit 1dfa72d

Browse files
authored
Remove "wee-alloc" feature. (#168)
The "wee_alloc" crate is no longer maintained and it leaks memory. Reported in #167. Signed-off-by: Piotr Sikora <[email protected]>
1 parent b33b2bc commit 1dfa72d

File tree

5 files changed

+11
-66
lines changed

5 files changed

+11
-66
lines changed

.github/workflows/rust.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,11 @@ jobs:
113113
RUSTFLAGS: -D warnings
114114
run: cargo build --release --all-targets --target=wasm32-wasi
115115

116-
- name: Build (wasm32-wasi with wee-alloc)
117-
env:
118-
RUSTFLAGS: -D warnings
119-
run: cargo build --release --all-targets --target=wasm32-wasi --features=wee-alloc
120-
121116
- name: Clippy (wasm32-wasi)
122117
env:
123118
RUSTFLAGS: -D warnings
124119
run: cargo clippy --release --all-targets --target=wasm32-wasi
125120

126-
- name: Clippy (wasm32-wasi with wee-alloc)
127-
env:
128-
RUSTFLAGS: -D warnings
129-
run: cargo clippy --release --all-targets --target=wasm32-wasi --features=wee-alloc
130-
131121
- name: Format (rustfmt)
132122
run: cargo fmt -- --check
133123

@@ -168,21 +158,11 @@ jobs:
168158
RUSTFLAGS: -D warnings
169159
run: cargo build --release --all-targets --target=wasm32-wasi
170160

171-
- name: Build (wasm32-wasi with wee-alloc)
172-
env:
173-
RUSTFLAGS: -D warnings
174-
run: cargo build --release --all-targets --target=wasm32-wasi --features=wee-alloc
175-
176161
- name: Clippy (wasm32-wasi)
177162
env:
178163
RUSTFLAGS: -D warnings
179164
run: cargo clippy --release --all-targets --target=wasm32-wasi
180165

181-
- name: Clippy (wasm32-wasi with wee-alloc)
182-
env:
183-
RUSTFLAGS: -D warnings
184-
run: cargo clippy --release --all-targets --target=wasm32-wasi --features=wee-alloc
185-
186166
- name: Format (rustfmt)
187167
run: cargo fmt -- --check
188168

@@ -217,21 +197,11 @@ jobs:
217197
RUSTFLAGS: -D warnings -Z wasi-exec-model=reactor
218198
run: cargo build --release --all-targets --target=wasm32-wasi
219199

220-
- name: Build (wasm32-wasi with wee-alloc)
221-
env:
222-
RUSTFLAGS: -D warnings -Z wasi-exec-model=reactor
223-
run: cargo build --release --all-targets --target=wasm32-wasi --features=wee-alloc
224-
225200
- name: Clippy (wasm32-wasi)
226201
env:
227202
RUSTFLAGS: -D warnings -Z wasi-exec-model=reactor
228203
run: cargo clippy --release --all-targets --target=wasm32-wasi
229204

230-
- name: Clippy (wasm32-wasi with wee-alloc)
231-
env:
232-
RUSTFLAGS: -D warnings -Z wasi-exec-model=reactor
233-
run: cargo clippy --release --all-targets --target=wasm32-wasi --features=wee-alloc
234-
235205
outdated:
236206
runs-on: ubuntu-latest
237207

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7+
## [Unreleased]
8+
9+
### Removed
10+
11+
- Removed `wee-alloc` feature, because that crate is no longer maintained
12+
and it leaks memory.
13+
714
## [0.2.0] - 2022-04-08
815

916
### Fixed
@@ -70,6 +77,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
7077
- Initial release.
7178

7279

80+
[Unreleased]: https://github.com/proxy-wasm/proxy-wasm-rust-sdk/compare/v0.2.0...HEAD
7381
[0.2.0]: https://github.com/proxy-wasm/proxy-wasm-rust-sdk/compare/v0.1.4...v0.2.0
7482
[0.1.4]: https://github.com/proxy-wasm/proxy-wasm-rust-sdk/compare/v0.1.3...v0.1.4
7583
[0.1.3]: https://github.com/proxy-wasm/proxy-wasm-rust-sdk/compare/v0.1.2...v0.1.3

Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@ repository = "https://github.com/proxy-wasm/proxy-wasm-rust-sdk"
1010
edition = "2018"
1111
build = "build.rs"
1212

13-
[features]
14-
wee-alloc = ["wee_alloc"]
15-
1613
[dependencies]
1714
hashbrown = "0.13"
1815
log = "0.4"
19-
wee_alloc = { version = "0.4", optional = true }
2016

2117
[dev-dependencies]
2218
cfg-if = "1.0"

bazel/cargo/Cargo.raze.lock

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ version = "1.1.0"
1717
source = "registry+https://github.com/rust-lang/crates.io-index"
1818
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
1919

20-
[[package]]
21-
name = "cfg-if"
22-
version = "0.1.10"
23-
source = "registry+https://github.com/rust-lang/crates.io-index"
24-
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
25-
2620
[[package]]
2721
name = "cfg-if"
2822
version = "1.0.0"
@@ -47,7 +41,7 @@ version = "0.2.6"
4741
source = "registry+https://github.com/rust-lang/crates.io-index"
4842
checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad"
4943
dependencies = [
50-
"cfg-if 1.0.0",
44+
"cfg-if",
5145
"libc",
5246
"wasi",
5347
]
@@ -73,15 +67,9 @@ version = "0.4.16"
7367
source = "registry+https://github.com/rust-lang/crates.io-index"
7468
checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8"
7569
dependencies = [
76-
"cfg-if 1.0.0",
70+
"cfg-if",
7771
]
7872

79-
[[package]]
80-
name = "memory_units"
81-
version = "0.4.0"
82-
source = "registry+https://github.com/rust-lang/crates.io-index"
83-
checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3"
84-
8573
[[package]]
8674
name = "num-integer"
8775
version = "0.1.44"
@@ -111,12 +99,11 @@ checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
11199
name = "proxy-wasm"
112100
version = "0.2.0"
113101
dependencies = [
114-
"cfg-if 1.0.0",
102+
"cfg-if",
115103
"chrono",
116104
"getrandom",
117105
"hashbrown",
118106
"log",
119-
"wee_alloc",
120107
]
121108

122109
[[package]]
@@ -131,18 +118,6 @@ version = "0.10.2+wasi-snapshot-preview1"
131118
source = "registry+https://github.com/rust-lang/crates.io-index"
132119
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
133120

134-
[[package]]
135-
name = "wee_alloc"
136-
version = "0.4.5"
137-
source = "registry+https://github.com/rust-lang/crates.io-index"
138-
checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e"
139-
dependencies = [
140-
"cfg-if 0.1.10",
141-
"libc",
142-
"memory_units",
143-
"winapi",
144-
]
145-
146121
[[package]]
147122
name = "winapi"
148123
version = "0.3.9"

src/allocator.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414

1515
use std::mem::MaybeUninit;
1616

17-
#[cfg(feature = "wee-alloc")]
18-
#[global_allocator]
19-
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
20-
2117
#[cfg_attr(
2218
all(target_arch = "wasm32", target_os = "unknown"),
2319
export_name = "malloc"

0 commit comments

Comments
 (0)