Use mimalloc when targeting musl

Also removes the armv7 linux build.
If you were using this, let me know!

Updates all dependencies
This commit is contained in:
2024-09-29 12:20:28 -06:00
parent dfda3d5ea3
commit c106123877
5 changed files with 137 additions and 105 deletions

View File

@@ -13,6 +13,12 @@ pub mod cmd;
pub mod obj;
pub mod util;
// musl's allocator is very slow, so use mimalloc when targeting musl.
// Otherwise, use the system allocator to avoid extra code size.
#[cfg(target_env = "musl")]
#[global_allocator]
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
enum LogLevel {
Error,

View File

@@ -291,6 +291,7 @@ fn to_objdiff_symbol(
if symbol.flags.is_hidden() {
flags.0 |= objdiff_core::obj::ObjSymbolFlags::Hidden;
}
let bytes = section.and_then(|s| s.symbol_data(symbol).ok()).map_or(vec![], |d| d.to_vec());
objdiff_core::obj::ObjSymbol {
name: symbol.name.clone(),
demangled_name: symbol.demangled_name.clone(),
@@ -302,6 +303,7 @@ fn to_objdiff_symbol(
addend,
virtual_address: None,
original_index: None,
bytes,
}
}