;; SB-IMPL::ROUND-BYTES-TO-WORDS
;; sbcl/src/code/run-program.lisp
Though the likelihood of something like the following occuring is prob. less
than realistic, it is the case that where N is a fixnum near the boundaries
of CL:MOST-POSITIVE-FIXNUM that the addition of N to (1- ,bytes-per-word) may
overflow the value of CL:MOST-POSITIVE-FIXNUM causing the second fixnum
assertion to fail erroneously, e.g.:
(sb-impl::round-bytes-to-words (1- most-positive-fixnum))
(macroexpand-1 '(sb-impl::round-bytes-to-words (1- most-positive-fixnum)))
Also, when is it permissible for the byte N to be a negative integer?
(defmacro tt--round-bytes-to-words (n)
(let ((bytes-per-word (/ sb-vm:n-machine-word-bits sb-vm:n-byte-bits)))
`(logandc2 (the fixnum (+ (the fixnum ,n) (1- ,bytes-per-word))) (1- ,bytes-per-word))))
;; SB-IMPL: :ROUND- BYTES-TO- WORDS code/run- program. lisp POSITIVE- FIXNUM that the addition of N to (1- ,bytes-per-word) may POSITIVE- FIXNUM causing the second fixnum :round- bytes-to- words (1- most-positive- fixnum) ) :round- bytes-to- words (1- most-positive- fixnum) ))
;; sbcl/src/
Though the likelihood of something like the following occuring is prob. less
than realistic, it is the case that where N is a fixnum near the boundaries
of CL:MOST-
overflow the value of CL:MOST-
assertion to fail erroneously, e.g.:
(sb-impl:
(macroexpand-1 '(sb-impl:
Also, when is it permissible for the byte N to be a negative integer?
(defmacro tt--round- bytes-to- words (n) machine- word-bits sb-vm:n- byte-bits) ))
(1- ,bytes-per-word))) (1- ,bytes-per-word))))
(let ((bytes-per-word (/ sb-vm:n-
`(logandc2 (the fixnum (+ (the fixnum ,n)
--
/s_P\