From f47ad62b88bcff263c3f14b3107968efffd8378a Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 4 Jul 2019 07:20:40 -0700 Subject: sha256: recycle I/O buffer used in stream hash. * chksum.c (sha256_stream): Use iobuf_get and iobuf_put. * gc.c (gc): Do not mark the list of recycled buffers; just consider them to be garbage and clear the list, like we do with recycled conses via rcyc_empty. * stream.c (iobuf_free_list): New static variable. (iobuf_get, iobuf_put, iobuf_list_empty): New functions. * stream.h (iobuf_get, iobuf_put, iobuf_list_empty): Declared. --- gc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gc.c') diff --git a/gc.c b/gc.c index 178e1cc6..4c8d9f6d 100644 --- a/gc.c +++ b/gc.c @@ -754,6 +754,7 @@ void gc(void) save_context(mc); gc_enabled = 0; rcyc_empty(); + iobuf_list_empty(); mark(&mc, &gc_stack_top); hash_process_weak(); prepare_finals(); -- cgit v1.2.3