hush: make memleak debugging more robust
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
873273da94
commit
27726cb6aa
@ -78,6 +78,7 @@
|
|||||||
* Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
|
* Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
|
||||||
*/
|
*/
|
||||||
#include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */
|
#include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */
|
||||||
|
#include <malloc.h> /* for malloc_trim */
|
||||||
#include <glob.h>
|
#include <glob.h>
|
||||||
/* #include <dmalloc.h> */
|
/* #include <dmalloc.h> */
|
||||||
#if ENABLE_HUSH_CASE
|
#if ENABLE_HUSH_CASE
|
||||||
@ -7265,6 +7266,10 @@ static int FAST_FUNC builtin_memleak(char **argv UNUSED_PARAM)
|
|||||||
void *p;
|
void *p;
|
||||||
unsigned long l;
|
unsigned long l;
|
||||||
|
|
||||||
|
#ifdef M_TRIM_THRESHOLD
|
||||||
|
/* Optional. Reduces probability of false positives */
|
||||||
|
malloc_trim(0);
|
||||||
|
#endif
|
||||||
/* Crude attempt to find where "free memory" starts,
|
/* Crude attempt to find where "free memory" starts,
|
||||||
* sans fragmentation. */
|
* sans fragmentation. */
|
||||||
p = malloc(240);
|
p = malloc(240);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user