Skip to content

Commit 84a0548

Browse files
committed
Merge branch 'snmalloc-rs-premerge' into HEAD
2 parents 6142c1e + 07e6602 commit 84a0548

File tree

12 files changed

+1340
-0
lines changed

12 files changed

+1340
-0
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: gitsubmodule
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10

.github/workflows/rust.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: snmalloc-rs CI
2+
3+
# The following should ensure that the workflow only runs a single set of actions
4+
# for each PR. But it will not apply this to pushes to the main branch.
5+
concurrency:
6+
group: ${{ github.ref }}-rust
7+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
8+
9+
on:
10+
push:
11+
branches: [ main ]
12+
pull_request:
13+
branches: [ main ]
14+
15+
workflow_dispatch:
16+
17+
env:
18+
CARGO_TERM_COLOR: always
19+
20+
jobs:
21+
build:
22+
23+
runs-on: ${{ matrix.os }}
24+
name: "${{ matrix.os }}-${{ matrix.release.name }}-${{ matrix.rust }} (features: ${{ matrix.features.name }})"
25+
defaults:
26+
run:
27+
shell: bash
28+
working-directory:
29+
./snmalloc-rs
30+
strategy:
31+
matrix:
32+
os: [windows-latest, macos-14, macos-15, ubuntu-latest]
33+
rust: [stable, nightly]
34+
release:
35+
- name: release
36+
flag: "--release"
37+
- name: debug
38+
flag: ""
39+
features:
40+
- name: default
41+
args: ""
42+
- name: debug
43+
args: "--features debug"
44+
- name: check
45+
args: "--features check"
46+
- name: build_cc
47+
args: '--features "build_cc usecxx17"'
48+
- name: native-cpu
49+
args: "--features native-cpu"
50+
- name: local_dynamic_tls
51+
args: "--features local_dynamic_tls"
52+
- name: lto
53+
args: "--features lto"
54+
# Don't abort runners if a single one fails
55+
fail-fast: false
56+
steps:
57+
- uses: actions-rs/toolchain@v1
58+
with:
59+
toolchain: ${{ matrix.rust }}
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
- name: update dependency
63+
run: |
64+
if bash -c 'uname -s | grep 'Linux' >/dev/null'; then
65+
sudo apt-get update -y && sudo apt-get --reinstall install -y libc6-dev
66+
fi
67+
shell: bash
68+
- name: Build
69+
run: cargo build ${{ matrix.release.flag }} --verbose ${{ matrix.features.args }}
70+
- name: Run tests
71+
run: cargo test ${{ matrix.release.flag }} --all ${{ matrix.features.args }}

snmalloc-rs/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
target
2+
Cargo.lock
3+
.idea
4+
5+
# vscode dirs
6+
.vscode/
7+
.vs/

snmalloc-rs/CHANGELOG.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
## Changelog
2+
3+
### 0.3.8
4+
5+
- Tracking upstream to match version 0.7.1
6+
- Recommended to upgrade from 0.3.7 to get an important bug fix.
7+
8+
### 0.3.7
9+
10+
- Tracking upstream to match version 0.7
11+
12+
### 0.3.4
13+
- Tracking upstream to match version 0.6.2
14+
15+
### 0.3.3
16+
- Tracking upstream to fix Linux PAL typo.
17+
18+
### 0.3.2
19+
- Tracking upstream to enable old Linux variants.
20+
21+
### 0.3.1
22+
- Fixes `build_cc` feature (broken in 0.3.0 release).
23+
- Fixes `native-cpu` feature (broken in 0.3.0 release).
24+
25+
### 0.3.0
26+
- Release to follow upstream 0.6.0
27+
- **upstream** Major redesign of the code to improve performance and
28+
enable a mode that provides strong checks against corruption.
29+
30+
### 0.3.0-beta.1
31+
32+
- Beta release to support snmalloc 2
33+
34+
### 0.2.28
35+
- Deprecation of `cache-friendly`
36+
- Use exposed `alloc_zeroed` from `snmalloc`
37+
- **upstream** changes of remote communication, corruption detection and compilation flag detection.
38+
39+
### 0.2.27
40+
41+
- Reduction of libc dependency
42+
- **upstream** Windows 7 and windows 8 compatibility added
43+
- **upstream** Option to use C++20 standards if available
44+
- **upstream** Preparations of cherification (heavy refactors of the structure)
45+
- **upstream** Cold routine annotations
46+
47+
### 0.2.26
48+
49+
- **upstream** Building adjustment
50+
- option of cc crate as build feature, only c compiler needed, no cmake required
51+
- Addition of dynamic local TLS option
52+
53+
### 0.2.25
54+
55+
- **upstream** Apple M1 support
56+
- **upstream** Building adjust
57+
- non-allocation tracking functions
58+
59+
### 0.2.24
60+
61+
- **upstream** update to use a more efficient power of 2 check
62+
- fix msvc support w/ crt-static
63+
64+
### 0.2.23
65+
66+
- **upstream** fix external pagemap usage
67+
68+
### 0.2.22
69+
70+
- **upstream** avoid amplification when routing
71+
- **upstream** remotely store sizeclass
72+
- **upstream** limit flat pagemap size
73+
- **upstream** limit medium slab header
74+
- **upstream** solaris support fix
75+
76+
### 0.2.21
77+
78+
- **upstream** bug fix for using failing to initialise meta-data
79+
80+
### 0.2.20
81+
82+
- **upstream** pass through Haiku build fix.
83+
- **upstream** fix typo in macro definition for 16MiB shared library shim.
84+
- **upstream** DragonFly support (userland).
85+
- **upstream** natural alignment for USE_MALLOC
86+
- **upstream** fix bug in pagemap when index has many level
87+
- **upstream** add constexpr annotation to align_up/down.
88+
89+
### 0.2.19
90+
91+
- **upstream** stats
92+
- **upstream** PAL updates and concepts
93+
- **upstream** ddd constexpr annotation to align_up/down
94+
- change macOS CI to follow xcode 12
95+
96+
### 0.2.18
97+
98+
- add msvc flag /EHsc to fix warning C4530
99+
100+
### 0.2.17
101+
102+
- **upstream** add backoff for large reservation
103+
- **upstream** default chunk configuration to 1mib
104+
- add new feature flags
105+
106+
### 0.2.16
107+
108+
- **upstream** New implementation of address space reservation leading to
109+
- better integration with transparent huge pages; and
110+
- lower address space requirements and fragmentation.
111+
- Notice MinGW broken state
112+
113+
### 0.2.15
114+
115+
- **upstream** fix VS2019 build
116+
- **upstream** fix wrong realloc behavior and performance issue
117+
118+
### 0.2.14
119+
120+
- **upstream** refactor ptr representation.
121+
- **upstream** improve for more targets and architectures.
122+
- seperate native CPU feature
123+
124+
### 0.2.13
125+
126+
- **upstream** large realloc fix and minor updates
127+
128+
### 0.2.12
129+
130+
- improve mingw support
131+
132+
### 0.2.11
133+
134+
- add android support
135+
- **upstream** support x86
136+
- **upstream** support android
137+
- **upstream** fix callback
138+
139+
### 0.2.10
140+
141+
- follow upstream 0.4.0
142+
- **upstream** defense TLS teardown
143+
- **upstream** adjust GCC warning
144+
- **upstream** other release optimizations
145+
146+
### 0.2.9
147+
148+
- **upstream** fix OpenEnclave
149+
- **upstream** adjust remote batch size (performance improved dramatically, see [benchmark](https://github.com/microsoft/snmalloc/pull/158#issuecomment-605816017)
150+
- **upstream** improve slow path performance for allocation
151+
152+
### 0.2.8
153+
154+
- More CI (**ARM64 on QEMU**)
155+
- **upstream** ARM(32/64) support
156+
- **upstream** x86-SGX support
157+
158+
### 0.2.7
159+
160+
- partially fixed `mingw`
161+
- **upstream** remote dealloc refactor (higher performance)
162+
- **upstream** remove extra assertions
163+
164+
### 0.2.6
165+
166+
- fix `macos`/`freebsd ` support
167+
- add more ci tests
168+
- mark the `mingw` problem

snmalloc-rs/Cargo.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[package]
2+
name = "snmalloc-rs"
3+
version = "0.3.8"
4+
authors = ["schrodingerzhu <i@zhuyi.fan>"]
5+
edition = "2021"
6+
license = "MIT"
7+
description = "rust bindings of snmalloc."
8+
keywords = ["snmalloc", "allocator"]
9+
categories = ["memory-management", "api-bindings"]
10+
homepage = "https://github.com/microsoft/snmalloc"
11+
repository = "https://github.com/microsoft/snmalloc"
12+
readme = "README.md"
13+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
14+
15+
[workspace]
16+
members = ["snmalloc-sys"]
17+
18+
[dependencies]
19+
snmalloc-sys = { version = "0.3.8", path = "snmalloc-sys", default-features = false }
20+
21+
[features]
22+
default = ["snmalloc-sys/build_cmake", "snmalloc-sys/usewait-on-address"]
23+
build_cc = ["snmalloc-sys/build_cc"]
24+
qemu = ["snmalloc-sys/qemu"]
25+
debug = ["snmalloc-sys/debug"]
26+
android-lld = ["snmalloc-sys/android-lld"]
27+
native-cpu = ["snmalloc-sys/native-cpu"]
28+
local_dynamic_tls = ["snmalloc-sys/local_dynamic_tls"]
29+
win8compat = ["snmalloc-sys/win8compat"]
30+
usecxx17 = ["snmalloc-sys/usecxx17"]
31+
check = ["snmalloc-sys/check"]
32+
lto = ["snmalloc-sys/lto"]
33+
notls = ["snmalloc-sys/notls"]
34+
stats = ["snmalloc-sys/stats"]
35+
usewait-on-address = ["snmalloc-sys/usewait-on-address"]
36+
libc-api = ["snmalloc-sys/libc-api"]

snmalloc-rs/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 SchrodingerZhu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)