summaryrefslogtreecommitdiff
path: root/src/sort.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sort.c')
-rw-r--r--src/sort.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/sort.c b/src/sort.c
index e2a3c7e3e..b7a6f7aec 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -1382,34 +1382,6 @@ sort_buffer_size (FILE *const *fps, size_t nfps,
return size;
}
-/* Initialize BUF. Reserve LINE_BYTES bytes for each line; LINE_BYTES
- must be at least sizeof (struct line). Allocate ALLOC bytes
- initially. */
-
-static void
-initbuf (struct buffer *buf, size_t line_bytes, size_t alloc)
-{
- /* Ensure that the line array is properly aligned. If the desired
- size cannot be allocated, repeatedly halve it until allocation
- succeeds. The smaller allocation may hurt overall performance,
- but that's better than failing. */
- while (true)
- {
- alloc += sizeof (struct line) - alloc % sizeof (struct line);
- buf->buf = malloc (alloc);
- if (buf->buf)
- break;
- alloc /= 2;
- if (alloc <= line_bytes + 1)
- xalloc_die ();
- }
-
- buf->line_bytes = line_bytes;
- buf->alloc = alloc;
- buf->used = buf->left = buf->nlines = 0;
- buf->eof = false;
-}
-
/* Initialize the randomly chosen MD5 state. */
static void