Here's a small cleanup I missed.
Alternatively one could make heap() return NULL rather than aborting,
but since it already used xmalloc, I'm tending to this..
commit cec33eb226df63f406f7eb70cd46d960ee02a060
Author: Pádraig Brady p...@draigbrady.com
Date: Tue Jul 13 08:23:52 2010 +0100
Pádraig Brady wrote:
Here's a small cleanup I missed.
Alternatively one could make heap() return NULL rather than aborting,
but since it already used xmalloc, I'm tending to this..
commit cec33eb226df63f406f7eb70cd46d960ee02a060
Author: Pádraig Brady p...@draigbrady.com
Date: Tue Jul 13
Pádraig Brady wrote:
On 13/07/10 15:35, Jim Meyering wrote:
I noticed that heap_insert's reallocation was awkward and inefficient.
Using x2nrealloc rather than xrealloc makes the code
cleaner as well as more efficient in the face of a growing
heap, and also handles integer overflow.
diff
On 13/07/10 15:35, Jim Meyering wrote:
I noticed that heap_insert's reallocation was awkward and inefficient.
Using x2nrealloc rather than xrealloc makes the code
cleaner as well as more efficient in the face of a growing
heap, and also handles integer overflow.
diff --git a/gl/lib/heap.c
Thanks a lot for all the hard work reviewing and revising this, Pádraig.