summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2010-12-11 00:27:05 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2010-12-11 00:29:13 -0800
commit27e997d0ebf3b2411e26b92a90365209e5cc1d00 (patch)
tree571e28d157699197104810161289df260aee4d3b /doc
parentc9db0ac6decb8121097d67e13659748ff3b3bcd6 (diff)
downloadcoreutils-27e997d0ebf3b2411e26b92a90365209e5cc1d00.tar.xz
sort: integer overflow checks in thread counts, etc.
* src/sort.c (specify_nthreads, merge_tree_init, init_node): (queue_init, sortlines, struct thread_args, sort, main): Use size_t, not unsigned long int, for thread counts, since thread counts are now used to compute sizes. (specify_nthreads): Check for size_t overflow. (merge_tree_init, sort): Shorten name of local variable, for readability. (merge_tree_init): Move constants next to each other in product, so that the constant folding is easier to see. (init_node): Now static. Add 'restrict' only where it might be helpful for compiler optimization. (queue_init): 2nd arg is now nthreads, not "reserve", which is a bit harder to follow. All uses changed. (struct thread_args): Rename lo_child to is_lo_child, so that it's obvious to the reader when we're talking about this boolean as opposed to the new lo_child member of the other structure. All uses changed. (sort): Remove unused local variable end_node. (main): Don't allow large thread counts to cause undefined behavior later, due to integer overflow.
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions