diff --git a/src/mtagmap.lisp b/src/mtagmap.lisp index 5107258..85733ea 100644 --- a/src/mtagmap.lisp +++ b/src/mtagmap.lisp @@ -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 @@ -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 diff --git a/src/struct.lisp b/src/struct.lisp index 9a282f6..7bc5a5c 100644 --- a/src/struct.lisp +++ b/src/struct.lisp @@ -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 diff --git a/t/symbol.lisp b/t/symbol.lisp index 413f9df..ac32789 100644 --- a/t/symbol.lisp +++ b/t/symbol.lisp @@ -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))))))))