Skip to content

Commit

Permalink
use libc::size_t as param type
Browse files Browse the repository at this point in the history
  • Loading branch information
rpelliard committed Mar 13, 2024
1 parent 8d18374 commit 1e6524e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ where
}

/// Get the maximum mmap window size
pub fn get_mwindow_size() -> Result<usize, Error> {
pub fn get_mwindow_size() -> Result<libc::size_t, Error> {
crate::init();

let mut size = 0;
Expand All @@ -250,7 +250,7 @@ pub fn get_mwindow_size() -> Result<usize, Error> {
}

/// Set the maximum mmap window size
pub fn set_mwindow_size(size: usize) -> Result<(), Error> {
pub fn set_mwindow_size(size: libc::size_t) -> Result<(), Error> {
crate::init();

unsafe {
Expand All @@ -264,7 +264,7 @@ pub fn set_mwindow_size(size: usize) -> Result<(), Error> {
}

/// Get the maximum memory that will be mapped in total by the library
pub fn get_mwindow_mapped_limit() -> Result<usize, Error> {
pub fn get_mwindow_mapped_limit() -> Result<libc::size_t, Error> {
crate::init();

let mut limit = 0;
Expand All @@ -281,7 +281,7 @@ pub fn get_mwindow_mapped_limit() -> Result<usize, Error> {

/// Set the maximum amount of memory that can be mapped at any time
/// by the library.
pub fn set_mwindow_mapped_limit(limit: usize) -> Result<(), Error> {
pub fn set_mwindow_mapped_limit(limit: libc::size_t) -> Result<(), Error> {
crate::init();

unsafe {
Expand All @@ -296,7 +296,7 @@ pub fn set_mwindow_mapped_limit(limit: usize) -> Result<(), Error> {

/// Get the maximum number of files that will be mapped at any time by the
/// library.
pub fn get_mwindow_file_limit() -> Result<usize, Error> {
pub fn get_mwindow_file_limit() -> Result<libc::size_t, Error> {
crate::init();

let mut limit = 0;
Expand All @@ -313,7 +313,7 @@ pub fn get_mwindow_file_limit() -> Result<usize, Error> {

/// Set the maximum number of files that can be mapped at any time
/// by the library. The default (0) is unlimited.
pub fn set_mwindow_file_limit(limit: usize) -> Result<(), Error> {
pub fn set_mwindow_file_limit(limit: libc::size_t) -> Result<(), Error> {
crate::init();

unsafe {
Expand Down

0 comments on commit 1e6524e

Please sign in to comment.