Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parity-util-mem: fix for FreeBSD #553

Merged
merged 2 commits into from Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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