It cannot be assumed that the given buffer will never be moved when
shrinking the allocated memory size with realloc(). So let's ignore
that optimization for now.
This patch makes Electric Fence happy on Linux.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Acked-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
entry->next = hash[i];
hash[i] = entry++;
hash_count[i]++;
- entries--;
}
}
}
free(hash_count);
- /* If we didn't use all hash entries, free the unused memory. */
- if (entries)
- index = realloc(index, memsize - entries * sizeof(*entry));
-
return index;
}