@@ -218,8 +218,9 @@ where
218
218
219
219
let default_page_size = 0x1000i64 ;
220
220
221
+ #[ allow( clippy:: useless_conversion) ]
221
222
let pagesize = nix:: unistd:: sysconf ( nix:: unistd:: SysconfVar :: PAGE_SIZE )
222
- . unwrap_or ( Some ( default_page_size) )
223
+ . unwrap_or ( Some ( default_page_size. try_into ( ) . unwrap ( ) ) )
223
224
. unwrap ( ) as usize ;
224
225
225
226
info ! ( "Using page size {}" , pagesize) ;
@@ -257,7 +258,7 @@ where
257
258
return Err ( MemoryError :: Allocation ( "Memory mapping failed" . to_string ( ) ) ) ;
258
259
}
259
260
260
- #[ cfg( any ( target_os = "macos" ) ) ]
261
+ #[ cfg( target_os = "macos" ) ]
261
262
{
262
263
// on linux this isn't required to commit memory
263
264
let error = libc:: madvise ( & mut addr as * mut usize as * mut libc:: c_void , size, libc:: MADV_WILLNEED ) ;
@@ -374,8 +375,9 @@ where
374
375
// pick a default, if system api call is not successful
375
376
let default_page_size = 0x1000i64 ;
376
377
378
+ #[ allow( clippy:: useless_conversion) ]
377
379
let _pagesize = nix:: unistd:: sysconf ( nix:: unistd:: SysconfVar :: PAGE_SIZE )
378
- . unwrap_or ( Some ( default_page_size) )
380
+ . unwrap_or ( Some ( default_page_size. try_into ( ) . unwrap ( ) ) )
379
381
. unwrap ( ) as usize ;
380
382
381
383
// We allocate a sufficiently "large" chunk of memory. A random
@@ -420,7 +422,7 @@ where
420
422
421
423
#[ cfg( any( target_os = "linux" , target_os = "macos" ) ) ]
422
424
fn dealloc ( frag : & mut Frag < T > ) -> Result < ( ) , Self :: Error > {
423
- dealloc_direct ( frag. info . 0 as * mut libc :: c_void )
425
+ dealloc_direct ( frag. info . 0 )
424
426
}
425
427
426
428
#[ cfg( target_os = "windows" ) ]
0 commit comments