AtlatestRepositorysigil-quic
sigil-quic / tree / scriptsseen-spy.sgl
1
;;; Records only sizes of actual returned buffers, never buffer references.2
(define-library (sigil quic tests seen spy)3
(export seen-spy-reset! seen-spy-allocations seen-spy-buffer)4
(begin5
(define captured '())7
(define (seen-spy-reset!) (set! captured '()))8
(define (seen-spy-allocations) (reverse captured))10
(define (seen-spy-buffer size fill)11
(let ((buffer (make-bytevector size fill)))12
(set! captured (cons (vector size (bytevector-length buffer)) captured))13
buffer))))