summaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenys Vlasenko2016-10-03 17:42:53 +0200
committerDenys Vlasenko2016-10-03 17:42:53 +0200
commit7f0ebbc69ed14b2f35e8bc62b03612b94e270955 (patch)
tree42711057a9eb9ea6222eb4107dfc7626df826e58 /shell/hush.c
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 'shell/hush.c')
-rw-r--r--shell/hush.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 668b1f2..9b51f38 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -9284,6 +9284,15 @@ static int FAST_FUNC builtin_memleak(char **argv UNUSED_PARAM)
if (l < (unsigned long)p) l = (unsigned long)p;
free(p);
+
+# if 0 /* debug */
+ {
+ struct mallinfo mi = mallinfo();
+ printf("top alloc:0x%lx malloced:%d+%d=%d\n", l,
+ mi.arena, mi.hblkhd, mi.arena + mi.hblkhd);
+ }
+# endif
+
if (!G.memleak_value)
G.memleak_value = l;