mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-30 08:59:56 +02:00
commit bash-20161014 snapshot
This commit is contained in:
+5
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user