Pádraig Brady wrote: > Jim Meyering wrote: ... >>> + char* buffer = malloc(BLOCKSIZE + 72); >> >> Spacing: >> >> char *buffer = malloc (BLOCKSIZE + 72); >> >>> + if (!buffer) >>> + return 1; >> >> Where is that memory freed? > > LOL. <blush!!> > > I also didn't include stdlib.h > I also forgot to update sha{224,384}_stream()
Glad you found those. > I also messed up the tabbing ... > Subject: [PATCH] digests, copy-file: increase the IO buffer size from 4KiB to > 32KiB > > This results in a significant decrease in syscall overhead > giving a 3% speedup to the digest utilities for example > (when processing large files from cache). > Storage is moved from the stack to the heap as some > threaded environments for example can have small stacks. ... > diff --git a/lib/copy-file.c b/lib/copy-file.c ... > +enum { IO_SIZE = 32*1024 }; Almost there. I like the enum. Did you consider making BLOCKSIZE, below, an enum, too? as long as you're changing it... > diff --git a/lib/md2.c b/lib/md2.c ... > + char* buffer = malloc (BLOCKSIZE + 72); Spacing again (search for 'char*'; there are more): char *buffer = malloc (BLOCKSIZE + 72); Thanks!