From 218a5ac054ce90211ce6d372be82d130a7078f0f Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 28 Jun 2021 16:48:25 +0200 Subject: [PATCH 1/2] parity-util-mem: fix for FreeBSD --- parity-util-mem/src/allocators.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; } From 231828c4d129b48eddb202f58aadd1f1f51706f5 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 28 Jun 2021 16:54:28 +0200 Subject: [PATCH 2/2] update the changelog --- parity-util-mem/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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