parent
13c2e444a8
commit
9e3cab4327
|
@ -21,7 +21,10 @@ M: mapped-file set-nth-unsafe
|
||||||
|
|
||||||
INSTANCE: mapped-file sequence
|
INSTANCE: mapped-file sequence
|
||||||
|
|
||||||
HOOK: <mapped-file> io-backend ( path length -- mmap )
|
HOOK: (mapped-file) io-backend ( path length -- mmap )
|
||||||
|
|
||||||
|
: <mapped-file> ( path length -- mmap )
|
||||||
|
>r normalize-path r> (mapped-file) ;
|
||||||
|
|
||||||
HOOK: close-mapped-file io-backend ( mmap -- )
|
HOOK: close-mapped-file io-backend ( mmap -- )
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@ IN: io.unix.mmap
|
||||||
>r f -roll r> open-r/w [ 0 mmap ] keep
|
>r f -roll r> open-r/w [ 0 mmap ] keep
|
||||||
over MAP_FAILED = [ close (io-error) ] when ;
|
over MAP_FAILED = [ close (io-error) ] when ;
|
||||||
|
|
||||||
M: unix <mapped-file> ( path length -- obj )
|
M: unix (mapped-file) ( path length -- obj )
|
||||||
swap normalize-path >r
|
swap >r
|
||||||
dup PROT_READ PROT_WRITE bitor MAP_FILE MAP_SHARED bitor
|
dup PROT_READ PROT_WRITE bitor MAP_FILE MAP_SHARED bitor
|
||||||
r> mmap-open f mapped-file boa ;
|
r> mmap-open f mapped-file boa ;
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,6 @@ M: wince with-privileges
|
||||||
nip call ;
|
nip call ;
|
||||||
|
|
||||||
: mmap-open ( path access-mode create-mode flProtect access -- handle handle address )
|
: mmap-open ( path access-mode create-mode flProtect access -- handle handle address )
|
||||||
>r >r >r >r normalize-path r> r> r> r>
|
|
||||||
{ "SeCreateGlobalPrivilege" "SeLockMemoryPrivilege" } [
|
{ "SeCreateGlobalPrivilege" "SeLockMemoryPrivilege" } [
|
||||||
>r >r 0 open-file dup f r> 0 0 f
|
>r >r 0 open-file dup f r> 0 0 f
|
||||||
CreateFileMapping [ win32-error=0/f ] keep
|
CreateFileMapping [ win32-error=0/f ] keep
|
||||||
|
@ -71,7 +70,7 @@ M: wince with-privileges
|
||||||
dup close-later
|
dup close-later
|
||||||
] with-privileges ;
|
] with-privileges ;
|
||||||
|
|
||||||
M: windows <mapped-file> ( path length -- mmap )
|
M: windows (mapped-file) ( path length -- mmap )
|
||||||
[
|
[
|
||||||
swap
|
swap
|
||||||
GENERIC_WRITE GENERIC_READ bitor
|
GENERIC_WRITE GENERIC_READ bitor
|
||||||
|
|
Loading…
Reference in New Issue