aboutsummaryrefslogtreecommitdiffstats
path: root/components/allocator/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/allocator/lib.rs')
-rw-r--r--components/allocator/lib.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/components/allocator/lib.rs b/components/allocator/lib.rs
index 45a535a6e41..826ce6e8aed 100644
--- a/components/allocator/lib.rs
+++ b/components/allocator/lib.rs
@@ -7,17 +7,18 @@
#[global_allocator]
static ALLOC: Allocator = Allocator;
-pub use crate::platform::*;
-
#[cfg(not(windows))]
pub use jemalloc_sys;
+pub use crate::platform::*;
+
#[cfg(not(windows))]
mod platform {
- use jemalloc_sys as ffi;
use std::alloc::{GlobalAlloc, Layout};
use std::os::raw::{c_int, c_void};
+ use jemalloc_sys as ffi;
+
/// Get the size of a heap block.
pub unsafe extern "C" fn usable_size(ptr: *const c_void) -> usize {
ffi::malloc_usable_size(ptr as *const _)
@@ -100,6 +101,7 @@ mod platform {
mod platform {
pub use std::alloc::System as Allocator;
use std::os::raw::c_void;
+
use winapi::um::heapapi::{GetProcessHeap, HeapSize, HeapValidate};
/// Get the size of a heap block.