Skip to content

Commit

Permalink
sync up with upstream (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingerZhu authored Nov 28, 2024
1 parent 743c672 commit a517429
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### 0.3.7

- Tracking upstream to match version 0.7

### 0.3.4
- Tracking upstream to match version 0.6.2

Expand Down
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "snmalloc-rs"
version = "0.3.6"
version = "0.3.7"
authors = ["schrodingerzhu <[email protected]>"]
edition = "2021"
license = "MIT"
Expand All @@ -13,13 +13,13 @@ readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[workspace]
members = ["snmalloc-sys" ]
members = ["snmalloc-sys"]

[dependencies]
snmalloc-sys = {version = "0.3.5", path = "snmalloc-sys", default-features = false }
snmalloc-sys = { version = "0.3.7", path = "snmalloc-sys", default-features = false }

[features]
default = ["snmalloc-sys/build_cmake"]
default = ["snmalloc-sys/build_cmake", "snmalloc-sys/usewait-on-address"]
build_cc = ["snmalloc-sys/build_cc"]
qemu = ["snmalloc-sys/qemu"]
debug = ["snmalloc-sys/debug"]
Expand All @@ -32,4 +32,4 @@ check = ["snmalloc-sys/check"]
lto = ["snmalloc-sys/lto"]
notls = ["snmalloc-sys/notls"]
stats = ["snmalloc-sys/stats"]
#nowait-on-target = ["snmalloc-sys/nowait-on-target"]
usewait-on-address = ["snmalloc-sys/usewait-on-address"]
8 changes: 4 additions & 4 deletions snmalloc-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "snmalloc-sys"
version = "0.3.6"
version = "0.3.7"
authors = ["schrodingerzhu <[email protected]>"]
edition = "2021"
license = "MIT"
Expand All @@ -13,8 +13,8 @@ build = "build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
cc = {version = "1.0",optional=true}
cmake = {version = "0.1",optional=true}
cc = { version = "1.0", optional = true }
cmake = { version = "0.1", optional = true }

[features]
default = ["build_cmake"]
Expand All @@ -31,4 +31,4 @@ check = []
lto = []
notls = []
stats = []
#usewait-on-target = []
usewait-on-address = []
5 changes: 3 additions & 2 deletions snmalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ fn main() {
let mut dst = cfg.build_target(target).build();

dst.push("./build");

println!("cargo:rustc-link-lib={}", target);
// we need to specify static modifier, otherwise the linker may not be smart enough to resolve
// dependency from snmalloc to libc/libgcc_s
println!("cargo:rustc-link-lib=static={}", target);

if cfg!(all(windows, target_env = "msvc")) {
if cfg!(not(feature = "win8compat")) {
Expand Down
2 changes: 1 addition & 1 deletion snmalloc-sys/snmalloc
Submodule snmalloc updated 47 files
+1 −0 .clang-format
+21 −9 .github/workflows/main.yml
+8 −5 .gitignore
+9 −0 CMakeLists.txt
+13 −18 docs/combininglock.md
+130 −0 docs/release/0.7/README.md
+1,054 −0 docs/release/0.7/perf-startup.svg
+1,640 −0 docs/release/0.7/snmalloc-msgpass.svg
+22 −0 fuzzing/CMakeLists.txt
+229 −0 fuzzing/snmalloc-fuzzer.cpp
+26 −1 src/snmalloc/aal/aal.h
+1 −0 src/snmalloc/aal/aal_arm.h
+1 −0 src/snmalloc/backend_helpers/buddy.h
+1 −0 src/snmalloc/backend_helpers/commonconfig.h
+1 −0 src/snmalloc/backend_helpers/smallbuddyrange.h
+2 −0 src/snmalloc/ds/flaglock.h
+9 −0 src/snmalloc/ds_core/defines.h
+1 −0 src/snmalloc/ds_core/helpers.h
+1 −0 src/snmalloc/ds_core/redblacktree.h
+2 −48 src/snmalloc/global/memcpy.h
+1 −0 src/snmalloc/mem/backend_concept.h
+2 −0 src/snmalloc/mem/corealloc.h
+3 −0 src/snmalloc/mem/external_alloc.h
+4 −0 src/snmalloc/mem/freelist.h
+1 −0 src/snmalloc/mem/localalloc.h
+1 −0 src/snmalloc/mem/metadata.h
+3 −0 src/snmalloc/override/jemalloc_compat.cc
+1 −0 src/snmalloc/override/malloc-extensions.h
+0 −9 src/snmalloc/override/memcpy.cc
+2 −0 src/snmalloc/pal/pal_freebsd.h
+1 −0 src/snmalloc/pal/pal_linux.h
+1 −0 src/snmalloc/pal/pal_netbsd.h
+1 −0 src/snmalloc/pal/pal_open_enclave.h
+2 −0 src/snmalloc/pal/pal_posix.h
+0 −2 src/snmalloc/pal/pal_timer_default.h
+3 −0 src/snmalloc/pal/pal_windows.h
+1 −0 src/test/func/client_meta/client_meta.cc
+1 −0 src/test/func/domestication/domestication.cc
+3 −76 src/test/func/memcpy/func-memcpy.cc
+1 −0 src/test/func/miracle_ptr/miracle_ptr.cc
+3 −0 src/test/func/pagemap/pagemap.cc
+8 −0 src/test/func/redblack/redblack.cc
+1 −0 src/test/func/sandbox/sandbox.cc
+1 −0 src/test/func/two_alloc_types/alloc1.cc
+1 −0 src/test/func/two_alloc_types/main.cc
+5 −0 src/test/perf/msgpass/msgpass.cc
+2 −0 src/test/setup.h
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ unsafe impl GlobalAlloc for SnMalloc {
/// The client must assure the following things:
/// - `alignment` is greater than zero
/// - Other constrains are the same as the rust standard library.
///
/// The program may be forced to abort if the constrains are not full-filled.
#[inline(always)]
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
Expand All @@ -48,6 +49,7 @@ unsafe impl GlobalAlloc for SnMalloc {
/// The client must assure the following things:
/// - the memory is acquired using the same allocator and the pointer points to the start position.
/// - Other constrains are the same as the rust standard library.
///
/// The program may be forced to abort if the constrains are not full-filled.
#[inline(always)]
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
Expand All @@ -68,6 +70,7 @@ unsafe impl GlobalAlloc for SnMalloc {
/// - the memory is acquired using the same allocator and the pointer points to the start position
/// - `alignment` fulfills all the requirements as `rust_alloc`
/// - Other constrains are the same as the rust standard library.
///
/// The program may be forced to abort if the constrains are not full-filled.
#[inline(always)]
unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
Expand Down

0 comments on commit a517429

Please sign in to comment.