aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-06-03 21:39:42 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-06-03 21:39:42 +0200
commitfe86d6b6361d07529288fa20aa5cab5472b64344 (patch)
tree289a0fb811f8f0deac205ed3b1bc2babab8a0401
parent71d73136250efa7dd5b5b023df76487f6e723830 (diff)
downloadbusybox-w32-fe86d6b6361d07529288fa20aa5cab5472b64344.tar.gz
busybox-w32-fe86d6b6361d07529288fa20aa5cab5472b64344.tar.bz2
busybox-w32-fe86d6b6361d07529288fa20aa5cab5472b64344.zip
appletlib.c: do not use PAGE_SIZE for malloc tweaking
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/appletlib.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 0dac0ba14..1bc45c491 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -34,17 +34,6 @@
34# include <malloc.h> /* for mallopt */ 34# include <malloc.h> /* for mallopt */
35#endif 35#endif
36 36
37/* Try to pull in PAGE_SIZE */
38#ifdef __linux__
39# include <sys/user.h>
40#endif
41#ifdef __GNU__ /* Hurd */
42# include <mach/vm_param.h>
43#endif
44#ifndef PAGE_SIZE
45# define PAGE_SIZE (4*1024) /* guess */
46#endif
47
48 37
49/* Declare <applet>_main() */ 38/* Declare <applet>_main() */
50#define PROTOTYPES 39#define PROTOTYPES
@@ -788,13 +777,13 @@ int main(int argc UNUSED_PARAM, char **argv)
788 * to keep before releasing to the OS 777 * to keep before releasing to the OS
789 * Default is way too big: 256k 778 * Default is way too big: 256k
790 */ 779 */
791 mallopt(M_TRIM_THRESHOLD, 2 * PAGE_SIZE); 780 mallopt(M_TRIM_THRESHOLD, 8 * 1024);
792#endif 781#endif
793#ifdef M_MMAP_THRESHOLD 782#ifdef M_MMAP_THRESHOLD
794 /* M_MMAP_THRESHOLD is the request size threshold for using mmap() 783 /* M_MMAP_THRESHOLD is the request size threshold for using mmap()
795 * Default is too big: 256k 784 * Default is too big: 256k
796 */ 785 */
797 mallopt(M_MMAP_THRESHOLD, 8 * PAGE_SIZE - 256); 786 mallopt(M_MMAP_THRESHOLD, 32 * 1024 - 256);
798#endif 787#endif
799 788
800#if !BB_MMU 789#if !BB_MMU