mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-05 03:10:50 +02:00
Bash-5.1 patch 9: fix bash malloc implementation of malloc_usable_size
This commit is contained in:
+6
-7
@@ -1286,13 +1286,12 @@ malloc_usable_size (mem)
|
||||
p = (union mhead *) ap - 1;
|
||||
}
|
||||
|
||||
/* XXX - should we return 0 if ISFREE? */
|
||||
maxbytes = binsize(p->mh_index);
|
||||
|
||||
/* So the usable size is the maximum number of bytes in the bin less the
|
||||
malloc overhead */
|
||||
maxbytes -= MOVERHEAD + MSLOP;
|
||||
return (maxbytes);
|
||||
/* return 0 if ISFREE */
|
||||
if (p->mh_alloc == ISFREE)
|
||||
return 0;
|
||||
|
||||
/* Since we use bounds checking, the usable size is the last requested size. */
|
||||
return (p->mh_nbytes);
|
||||
}
|
||||
|
||||
#if !defined (NO_VALLOC)
|
||||
|
||||
+1
-1
@@ -25,6 +25,6 @@
|
||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
#define PATCHLEVEL 8
|
||||
#define PATCHLEVEL 9
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
|
||||
Reference in New Issue
Block a user