commit bash-20161014 snapshot

This commit is contained in:
Chet Ramey
2016-10-19 15:14:38 -04:00
parent ff293129ec
commit 03b415d33e
15 changed files with 219 additions and 58 deletions
+5 -1
View File
@@ -1033,11 +1033,15 @@ internal_realloc (mem, n, file, line, flags)
_mstats.bytesreq += (n < tocopy) ? 0 : n - tocopy;
#endif
/* If we're reallocating to the same size as previously, return now */
if (n == p->mh_nbytes)
return mem;
/* See if desired size rounds to same power of 2 as actual size. */
nbytes = ALLOCATED_BYTES(n);
/* If ok, use the same block, just marking its size as changed. */
if (RIGHT_BUCKET(nbytes, nunits))
if (RIGHT_BUCKET(nbytes, nunits) || RIGHT_BUCKET(nbytes, nunits-1))
{
#if 0
m = (char *)mem + p->mh_nbytes;