Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev authored and rnijveld committed Apr 16, 2024
1 parent 5511b14 commit 66c9d9f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cargo-fuzz = true
debug = true

[features]
default = ["libz-rs-sys/rust-allocator"]
c-allocator = ["libz-rs-sys/c-allocator"]
rust-allocator = ["libz-rs-sys/rust-allocator"]

Expand All @@ -31,6 +32,7 @@ features = ["__internal-fuzz"]

[dependencies.libz-rs-sys]
path = "../libz-rs-sys"
default-features = false

# Prevent this from interfering with workspaces
[workspace]
Expand Down
8 changes: 4 additions & 4 deletions fuzz/fuzz_targets/end_to_end.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ fn compress_slice_ng<'a>(
total_out: 0,
msg: std::ptr::null_mut(),
state: std::ptr::null_mut(),
zalloc: zlib_rs::allocate::zcalloc,
zfree: zlib_rs::allocate::zcfree,
zalloc: zlib_rs::allocate::zalloc_c,
zfree: zlib_rs::allocate::zfree_c,
opaque: std::ptr::null_mut(),
data_type: 0,
adler: 0,
Expand Down Expand Up @@ -177,8 +177,8 @@ fn uncompress_slice_ng<'a>(
total_out: 0,
msg: std::ptr::null_mut(),
state: std::ptr::null_mut(),
zalloc: ::zlib_rs::allocate::zcalloc,
zfree: ::zlib_rs::allocate::zcfree,
zalloc: zlib_rs::allocate::zalloc_c,
zfree: zlib_rs::allocate::zfree_c,
opaque: std::ptr::null_mut(),
data_type: 0,
adler: 0,
Expand Down
3 changes: 3 additions & 0 deletions libz-rs-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const _: () =

#[allow(unreachable_code)]
const DEFAULT_ZALLOC: Option<alloc_func> = 'blk: {
// this `break 'blk'` construction exists to generate just one compile error and not other
// warnings when multiple allocators are configured.

#[cfg(feature = "c-allocator")]
break 'blk Some(zlib_rs::allocate::zalloc_c);

Expand Down
4 changes: 0 additions & 4 deletions zlib-rs/src/crc32/pclmulqdq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ use crate::{crc32::slice_to_uninit, CRC32_INITIAL_VALUE};
#[repr(C, align(16))]
struct Align16<T>(T);

#[derive(Debug)]
#[repr(C, align(32))]
struct Align32<T>(T);

#[cfg(target_arch = "x86_64")]
const fn reg(input: [u32; 4]) -> __m128i {
// safety: any valid [u32; 4] represents a valid __m128i
Expand Down

0 comments on commit 66c9d9f

Please sign in to comment.