summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko2016-10-03 17:42:53 +0200
committerDenys Vlasenko2016-10-03 17:42:53 +0200
commit7f0ebbc69ed14b2f35e8bc62b03612b94e270955 (patch)
tree42711057a9eb9ea6222eb4107dfc7626df826e58 /libbb
parenta769390da604b4815535e296d8a46fdf9094c2c7 (diff)
downloadbusybox-7f0ebbc69ed14b2f35e8bc62b03612b94e270955.zip
busybox-7f0ebbc69ed14b2f35e8bc62b03612b94e270955.tar.gz
hush: add commented-out debug printouts in "memleak" built-in
Allocation addresses of malloc() are jittery, thought I had a mem leak in hush, but it was malloc variability. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index f760af2..2d01a3a 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -942,6 +942,14 @@ int main(int argc UNUSED_PARAM, char **argv)
*/
mallopt(M_MMAP_THRESHOLD, 32 * 1024 - 256);
#endif
+#if 0 /*def M_TOP_PAD*/
+ /* When the program break is increased, then M_TOP_PAD bytes are added
+ * to the sbrk(2) request. When the heap is trimmed because of free(3),
+ * this much free space is preserved at the top of the heap.
+ * glibc default seems to be way too big: 128k, but need to verify.
+ */
+ mallopt(M_TOP_PAD, 8 * 1024);
+#endif
#if !BB_MMU
/* NOMMU re-exec trick sets high-order bit in first byte of name */