diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-11-20 21:48:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-20 21:48:28 +0000 |
commit | 6e2b0a02e662a83c1748dda9825dc96da5374f6f (patch) | |
tree | d9bd34d4f9d9212ccec761e056ed184e250853bf /test/sys/test_pthread.rs | |
parent | 2ad2f48693b7ecb262d4f887573d1170f4f79133 (diff) | |
parent | d34696c84b0d3b49456fa6f0f12af91d94b11371 (diff) | |
download | nix-6e2b0a02e662a83c1748dda9825dc96da5374f6f.zip |
Merge #1870
1870: mmap addr r=asomers a=JonathanWoollett-Light
Uses `Some<size_t>` instead of `*mut c_void` for the `addr` passed to [`sys::mman::mmap`](https://docs.rs/nix/latest/nix/sys/mman/fn.mmap.html).
In this instance we are not usefully passing a pointer, it will never be dereferenced. We are passing a location which represents where to attach the shared memory to.
In this case `size_t` better represents an address and not a pointer, and `Option<size_t>` better represents an optional argument than `NULLPTR`.
In C since there is no optional type this is a pointer as this allows it be null which is an alias here for `None`.
Co-authored-by: Jonathan <jonathanwoollettlight@gmail.com>
Diffstat (limited to 'test/sys/test_pthread.rs')
0 files changed, 0 insertions, 0 deletions