From 5afc44c1082ae7088511f318aa9bd3d4b25ba3c6 Mon Sep 17 00:00:00 2001 From: Piotr Szarmanski Date: Fri, 30 Dec 2022 18:29:24 +0100 Subject: Implement buffer reuse encoding. This implements a buffer reuse mechanism in eris-encode. This is also a backwards incompatible change, as the provided OUTPUT-FUNCTION now has an additional argument and has to return an octet-vector buffer of equal size. This is not yet implemented optimally, but should amount to a reduce of memory usage and GC required, especially for larger files. --- src/hash-backend.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/hash-backend.lisp') diff --git a/src/hash-backend.lisp b/src/hash-backend.lisp index c44c2d0..0fa095a 100644 --- a/src/hash-backend.lisp +++ b/src/hash-backend.lisp @@ -32,7 +32,7 @@ output-function (lambda (block reference) (declare (type octet-vector block reference)) (setf (gethash reference hash-table) - block) + (copy-seq block)) block))))) (defmethod fetch-data (read-capability (backend hash-backend) &key &allow-other-keys) -- cgit v1.2.3