diff options
author | Bo Borgerson <gigabo@gmail.com> | 2008-04-22 16:19:58 -0400 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-06-17 00:52:30 +0200 |
commit | 94cecb5cf6922130f10a640614fb2e16945c5432 (patch) | |
tree | c6d73d47158bdf19f13de11577bb5bf5602f4765 /src/shuf.c | |
parent | 58db1bb942bd8f23b33d8f21423e7da330312133 (diff) | |
download | coreutils-94cecb5cf6922130f10a640614fb2e16945c5432.tar.xz |
join: improve memory management
* src/join.c (struct seq): Use a (struct line **) for `lines' rather than
one long (struct line *). This allows individual lines to be swapped out
if necessary.
(reset_line): Get a line ready for new input.
(init_linep): Create a new line and assign it to the the pointer passed in.
(spareline[2]): Hold a spare line for each input file.
(free_spareline): Clean up.
(get_line): Take a (struct line **) instead of a (struct line *). If the
line to be overwritten is the previous line for the current file then swap
it out for the spare.
(join): Accomodate new structure of SEQs and new parameters to get_line;
Don't free stale lines until the end -- they're re-usable now.
(dup_line): Remove function.
* NEWS: Mention the performance improvement.
Diffstat (limited to 'src/shuf.c')
0 files changed, 0 insertions, 0 deletions