Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/mtagmap.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@
(mtagmap-fd mtagmap) fd
(mtagmap-ptr mtagmap) ptr
(mtagmap-len mtagmap) bytes
fd nil ptr nil))
fd nil ptr nil)
#-linux
(setf
(mtagmap-protection mtagmap) protection
(mtagmap-sharing mtagmap) sharing) )
(when ptr
(osicat-posix:munmap ptr bytes)))))
(when fd
Expand All @@ -151,7 +155,15 @@
(osicat-posix:ftruncate (mtagmap-fd mtagmap) new-len))
(remap ()
(setf (mtagmap-ptr mtagmap)
#+linux
(osicat-posix:mremap (mtagmap-ptr mtagmap) len new-len osicat-posix:MREMAP-MAYMOVE)
#-linux
(let ((ptr (mtagmap-ptr mtagmap))
(fd (mtagmap-fd mtagmap))
(protection (mtagmap-protection mtagmap))
(sharing (mtagmap-sharing mtagmap)))
(assert (zerop (osicat-posix:munmap ptr len)))
(osicat-posix:mmap (cffi:null-pointer) new-len protection sharing fd 0))
len new-len)))
(let (done)
(unwind-protect
Expand Down
3 changes: 3 additions & 0 deletions src/struct.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ Remains constant across remappings of the memory mapped regions to different off
(ptr (cffi:null-pointer) :type machine-pointer)
(len 0 :type mindex)

#-linux protection
#-linux sharing

class
layout
instantiator
Expand Down
4 changes: 2 additions & 2 deletions t/symbol.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
(setf (gethash sym table) mptr))))
(do-all-syms (sym)
(add sym (lisp-object-to-mptr sym)))
(iter (for (sym mptr) in table)
(iter (for (sym mptr) in-hashtable table)
(stefil:is (= mptr (lisp-object-to-mptr sym))))
(do-all-syms (sym)
(stefil:is (eq sym (mptr-to-lisp-object (lisp-object-to-mptr sym)))))
(iter (for (sym mptr) in table)
(iter (for (sym mptr) in-hashtable table)
(stefil:is (eq sym (mptr-to-lisp-object mptr))))
(do-all-syms (sym)
(add sym (lisp-object-to-mptr sym))))))))
Expand Down