From 96909f371e26747f15df89b38fc2a64ec8a4f946 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 28 Jun 2021 20:30:13 +0200 Subject: [PATCH] parity-util-mem: fix for FreeBSD (#553) * parity-util-mem: fix for FreeBSD * update the changelog --- parity-util-mem/CHANGELOG.md | 1 + parity-util-mem/src/allocators.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/parity-util-mem/CHANGELOG.md b/parity-util-mem/CHANGELOG.md index 0c88476ca..e4c532662 100644 --- a/parity-util-mem/CHANGELOG.md +++ b/parity-util-mem/CHANGELOG.md @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog]. [Keep a Changelog]: http://keepachangelog.com/en/1.0.0/ ## [Unreleased] +- Fixed `malloc_usable_size` for FreeBSD. [#553](https://github.com/paritytech/parity-common/pull/553) ## [0.9.0] - 2021-01-27 ### Breaking diff --git a/parity-util-mem/src/allocators.rs b/parity-util-mem/src/allocators.rs index fca674ebe..1eadf701b 100644 --- a/parity-util-mem/src/allocators.rs +++ b/parity-util-mem/src/allocators.rs @@ -97,9 +97,12 @@ mod usable_size { libmimalloc_sys::mi_usable_size(ptr as *mut _) } - } else if #[cfg(any(target_os = "linux", target_os = "android"))] { - - /// Linux call system allocator (currently malloc). + } else if #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + ))] { + /// Linux/BSD call system allocator (currently malloc). extern "C" { pub fn malloc_usable_size(ptr: *const c_void) -> usize; }