Skip to content

Commit

Permalink
parity-util-mem: fix for FreeBSD (#553)
Browse files Browse the repository at this point in the history
* parity-util-mem: fix for FreeBSD

* update the changelog
  • Loading branch information
ordian committed Jun 28, 2021
1 parent 7c2a9b2 commit 96909f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions parity-util-mem/CHANGELOG.md
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions parity-util-mem/src/allocators.rs
Expand Up @@ -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;
}
Expand Down

0 comments on commit 96909f3

Please sign in to comment.