Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 383325711
  • Loading branch information
common-lisp-dev-copybara authored and copybara-github committed Jul 22, 2021
1 parent 8039a65 commit a782a20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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

0 comments on commit a782a20

Please sign in to comment.