Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #338

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

test #338

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
3 changes: 2 additions & 1 deletion buffers.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
(backpatches (make-word-buffer 10))
;; When copying a fixed-size wire-level primitive that crosses a block boundary,
;; use the scratchpad first, then copy two subsequences of octets.
(scratchpad (make-array 8 :element-type '(unsigned-byte 8)))
(scratchpad (make-array 8 :element-type '(unsigned-byte 8)
#+ubsan :initial-element #+ubsan 0))
(n-gap-bytes 0 :type fixnum)
(target nil) ; the destination of these octets, a STREAM typically
;; The BUFFER can also pretend to be stream by implementing CHAR-OUT
Expand Down
9 changes: 6 additions & 3 deletions wire-format.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -819,9 +819,12 @@
;; Don't worry about unaligned writes - they're still faster than
;; looping. Todo: featurize for non-x86 and other than SBCL.
(if (buffer-ensure-space buffer ,n-bytes)
(let ((index (buffer-index buffer)))
(setf (,accessor (buffer-sap buffer) index) val
(buffer-index buffer) (+ index ,n-bytes))
(let ((index (buffer-index buffer))
(block (buffer-block buffer)))
(sb-sys:with-pinned-objects (block)
(setf (,accessor (sb-sys:vector-sap block) index) val
(buffer-index buffer) (+ index ,n-bytes)))
#+ubsan (sb-vm:%unpoison-range block index (buffer-index buffer))
,n-bytes)
(let ((scratchpad (octet-buffer-scratchpad buffer)))
(setf (,accessor (sb-sys:vector-sap scratchpad) 0) val)
Expand Down