Skip to content

Commit db24ee9

Browse files
committed
os: introduce cross-platform MemoryMap bindings
Basically, one may just do: MemoryMap::new(16, ~[ MapExecutable, MapReadable, MapWritable ]) And executable+readable+writable chunk of at least 16 bytes size will be allocated and freed with the result of `MemoryMap::new`.
1 parent 4a868c7 commit db24ee9

File tree

2 files changed

+358
-4
lines changed

2 files changed

+358
-4
lines changed

src/libstd/libc.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,8 @@ pub mod types {
732732
wProcessorArchitecture: 0,
733733
wReserved: 0,
734734
dwPageSize: 0,
735-
lpMinimumApplicationAddress: ptr::null(),
736-
lpMaximumApplicationAddress: ptr::null(),
735+
lpMinimumApplicationAddress: ptr::mut_null(),
736+
lpMaximumApplicationAddress: ptr::mut_null(),
737737
dwActiveProcessorMask: 0,
738738
dwNumberOfProcessors: 0,
739739
dwProcessorType: 0,
@@ -1011,7 +1011,7 @@ pub mod consts {
10111011
}
10121012
pub mod extra {
10131013
use libc::types::os::arch::c95::c_int;
1014-
use libc::types::os::arch::extra::{DWORD, BOOL};
1014+
use libc::types::os::arch::extra::{WORD, DWORD, BOOL};
10151015

10161016
pub static TRUE : BOOL = 1;
10171017
pub static FALSE : BOOL = 0;
@@ -3002,7 +3002,8 @@ pub mod funcs {
30023002
LPCVOID};
30033003
use libc::types::os::arch::extra::{LPSECURITY_ATTRIBUTES, LPSTARTUPINFO,
30043004
LPPROCESS_INFORMATION,
3005-
LPMEMORY_BASIC_INFORMATION};
3005+
LPMEMORY_BASIC_INFORMATION,
3006+
LPSYSTEM_INFO};
30063007
use libc::types::os::arch::extra::{HANDLE, LPHANDLE};
30073008

30083009
#[abi = "stdcall"]

0 commit comments

Comments
 (0)