Skip to content

Commit b3033ba

Browse files
Ryan ClantonRyan Clanton
authored andcommitted
perform clippy and fmt
1 parent 20ac6ff commit b3033ba

File tree

3 files changed

+17
-37
lines changed

3 files changed

+17
-37
lines changed

libmimalloc-sys/build.rs

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -111,27 +111,20 @@ fn main() {
111111
}
112112
} else if target_env == "gnu" {
113113
cfg = cfg.define("CMAKE_SH", "CMAKE_SH-NOTFOUND");
114-
// cc::get_compiler have /nologo /MD default flags that are cmake::Config
115-
// defaults to. Those flags prevents mimalloc from building on windows
116-
// extracted from default cmake configuration on windows
114+
// Those flags prevents mimalloc from building on windows
117115
if is_debug {
118116
// CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG
119-
cfg = cfg.cflag("-static -ffunction-sections -fdata-sections -m64 -O3 -fpic");
117+
cfg = cfg.cflag("-static -ffunction-sections -fdata-sections -m64 -O2 -fpic");
120118
} else {
121119
// CMAKE_C_FLAGS + CMAKE_C_FLAGS_RELEASE
122120
cfg = cfg.cflag("-static -ffunction-sections -fdata-sections -m64 -O3 -fpic");
123121
}
124122
};
125123

126124
let mut out_dir = "./build".to_string();
127-
if cfg!(all(windows, target_env = "msvc")) {
128-
if target_env == "msvc" {
129-
out_dir.push('/');
130-
out_dir.push_str(win_folder);
131-
} else if target_env == "gnu" {
132-
out_dir.push('/');
133-
out_dir.push_str(win_folder);
134-
}
125+
if cfg!(all(windows)) {
126+
out_dir.push('/');
127+
out_dir.push_str(win_folder);
135128
}
136129
let out_name = if cfg!(all(windows)) {
137130
if is_debug {
@@ -140,27 +133,21 @@ fn main() {
140133
} else {
141134
"mimalloc-static-debug"
142135
}
136+
} else if cfg!(feature = "secure") {
137+
"mimalloc-static-secure"
143138
} else {
144-
if cfg!(feature = "secure") {
145-
"mimalloc-static-secure"
146-
} else {
147-
"mimalloc-static"
148-
}
139+
"mimalloc-static"
149140
}
150-
} else {
151-
if is_debug {
152-
if cfg!(feature = "secure") {
153-
"mimalloc-secure-debug"
154-
} else {
155-
"mimalloc-debug"
156-
}
141+
} else if is_debug {
142+
if cfg!(feature = "secure") {
143+
"mimalloc-secure-debug"
157144
} else {
158-
if cfg!(feature = "secure") {
159-
"mimalloc-secure"
160-
} else {
161-
"mimalloc"
162-
}
145+
"mimalloc-debug"
163146
}
147+
} else if cfg!(feature = "secure") {
148+
"mimalloc-secure"
149+
} else {
150+
"mimalloc"
164151
};
165152

166153
// Build mimalloc-static

libmimalloc-sys/src/lib.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ extern "C" {
2020
/// Returns a unique pointer if called with `size` 0.
2121
pub fn mi_malloc(size: usize) -> *mut c_void;
2222

23-
/// Allocate `count` items of `size` length each.
24-
///
25-
/// Returns `null` if `count * size` overflows or on out-of-memory.
26-
///
27-
/// All items are initialized to zero.
28-
pub fn mi_calloc(count: usize, size: usize) -> *mut c_void;
29-
3023
/// Re-allocate memory to `newsize` bytes.
3124
///
3225
/// Return pointer to the allocated memory or null if out of memory. If null

0 commit comments

Comments
 (0)