Skip to content

Commit

Permalink
when shrinking, always wipe memory to zero even if we don't actually
Browse files Browse the repository at this point in the history
truncate the file
  • Loading branch information
ilitirit committed Sep 9, 2009
1 parent 48deb8a commit e66775e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mtagmap.lisp
Expand Up @@ -191,7 +191,7 @@
(declare (type mindex next))
(when (> (the mindex (+ next bytes)) (the mindex len))
(mtagmap-extend-alloc mtagmap bytes))
(incf (mtagmap-next mtagmap) bytes)
(setf (mtagmap-next mtagmap) (the mindex (+ next bytes)))
next)))

(defun mtagmap-check-read (mtagmap)
Expand Down Expand Up @@ -236,12 +236,12 @@
(mtagmap-check mtagmap)
(let* ((next (mtagmap-next mtagmap))
(bytes (round-up-to-pagesize next)) (file-len (mtagmap-file-length mtagmap)))
(assert (>= file-len bytes))
(unless (= next bytes)
(osicat-posix:memset (cffi:inc-pointer (mtagmap-ptr mtagmap) next)
0 (- bytes next)))
(unless (= bytes file-len)
(assert (> file-len bytes))
(assert (>= bytes next))
(unless (= next bytes)
(osicat-posix:memset (cffi:inc-pointer (mtagmap-ptr mtagmap) next)
0 (- bytes next)))
(mtagmap-resize mtagmap bytes))))

(defun mtagmap-schema (mtagmap)
Expand Down

0 comments on commit e66775e

Please sign in to comment.