]> git.ipfire.org Git - thirdparty/coreutils.git/commit
dd: avoid buffer allocations unless needed
authorOndrej Oprala <ooprala@redhat.com>
Tue, 22 Jan 2013 13:21:23 +0000 (14:21 +0100)
committerPádraig Brady <P@draigBrady.com>
Sun, 14 Apr 2013 00:00:45 +0000 (01:00 +0100)
commit8901e010fa24ba375d53e3e37fc7819621adcf19
tree1f20f49bb0c455525b042e838462d4396c97a314
parent4114c93af398d7aecb5eb253f90d9b4cc0785643
dd: avoid buffer allocations unless needed

* src/dd.c: Add new static global variable ibuf.
(alloc_ibuf, alloc_obuf): New functions factored from dd_copy().
(dd_copy): Call the new functions to allocate memory for
ibuf and obuf when necessary.
(skip): Likewise.
* tests/dd/no-allocate.sh: New test.
* tests/local.mk: Reference the test.
src/dd.c
tests/dd/no-allocate.sh [new file with mode: 0755]
tests/local.mk