mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-06 10:12:38 +02:00
commit bash-20180615 snapshot
This commit is contained in:
+4
-8
@@ -111,6 +111,7 @@
|
||||
# define NO_VALLOC
|
||||
#endif
|
||||
|
||||
/* SIZEOF_LONG * 4 - 2, usable bins from 1..NBUCKETS-1 */
|
||||
#define NBUCKETS 30
|
||||
|
||||
#define ISALLOC ((char) 0xf7) /* magic byte that implies allocation */
|
||||
@@ -195,6 +196,8 @@ typedef union _malloc_guard {
|
||||
#define LESSCORE_MIN 10
|
||||
#define LESSCORE_FRC 13
|
||||
|
||||
#define MMAP_THRESHOLD 15 /* must be greater than SPLIT_MAX, COMBINE_MAX */
|
||||
|
||||
#define STARTBUCK 1
|
||||
|
||||
/* Flags for the internal functions. */
|
||||
@@ -1053,12 +1056,9 @@ internal_realloc (mem, n, file, line, flags)
|
||||
/* If ok, use the same block, just marking its size as changed. */
|
||||
if (RIGHT_BUCKET(nbytes, nunits) || RIGHT_BUCKET(nbytes, nunits-1))
|
||||
{
|
||||
#if 0
|
||||
m = (char *)mem + p->mh_nbytes;
|
||||
#else
|
||||
/* Compensate for increment above. */
|
||||
m -= 4;
|
||||
#endif
|
||||
|
||||
*m++ = 0; *m++ = 0; *m++ = 0; *m++ = 0;
|
||||
m = (char *)mem + (p->mh_nbytes = n);
|
||||
|
||||
@@ -1120,11 +1120,7 @@ internal_memalign (alignment, size, file, line, flags)
|
||||
if (((long) ptr & (alignment - 1)) == 0)
|
||||
return ptr;
|
||||
/* Otherwise, get address of byte in the block that has that alignment. */
|
||||
#if 0
|
||||
aligned = (char *) (((long) ptr + alignment - 1) & -alignment);
|
||||
#else
|
||||
aligned = (char *) (((long) ptr + alignment - 1) & (~alignment + 1));
|
||||
#endif
|
||||
|
||||
/* Store a suitable indication of how to free the block,
|
||||
so that free can find the true beginning of it. */
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ _print_malloc_stats (s, fp)
|
||||
{
|
||||
v = malloc_bucket_stats (i);
|
||||
if (v.nmal > 0)
|
||||
fprintf (fp, "%8lu\t%4d\t%6d\t%5d\t%8d\t%d %5d %8d\n", (unsigned long)v.blocksize, v.nfree, v.nused, v.nmal, v.nmorecore, v.nlesscore, v.nsplit, v.ncoalesce);
|
||||
fprintf (fp, "%8lu\t%4d\t%6d\t%5d\t%8d\t%8d %5d %8d\n", (unsigned long)v.blocksize, v.nfree, v.nused, v.nmal, v.nmorecore, v.nlesscore, v.nsplit, v.ncoalesce);
|
||||
totfree += v.nfree * v.blocksize;
|
||||
totused += v.nused * v.blocksize;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user