011-remove-non-posix-mallopt.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. diff -Nur busybox-1.23.0.orig/libbb/appletlib.c busybox-1.23.0/libbb/appletlib.c
  2. --- busybox-1.23.0.orig/libbb/appletlib.c 2014-11-20 01:08:23.000000000 +0100
  3. +++ busybox-1.23.0/libbb/appletlib.c 2015-03-07 09:10:56.000000000 +0100
  4. @@ -28,13 +28,6 @@
  5. */
  6. #include "busybox.h"
  7. -#if !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \
  8. - || defined(__APPLE__) \
  9. - )
  10. -# include <malloc.h> /* for mallopt */
  11. -#endif
  12. -
  13. -
  14. /* Declare <applet>_main() */
  15. #define PROTOTYPES
  16. #include "applets.h"
  17. @@ -792,21 +785,6 @@
  18. int main(int argc UNUSED_PARAM, char **argv)
  19. #endif
  20. {
  21. - /* Tweak malloc for reduced memory consumption */
  22. -#ifdef M_TRIM_THRESHOLD
  23. - /* M_TRIM_THRESHOLD is the maximum amount of freed top-most memory
  24. - * to keep before releasing to the OS
  25. - * Default is way too big: 256k
  26. - */
  27. - mallopt(M_TRIM_THRESHOLD, 8 * 1024);
  28. -#endif
  29. -#ifdef M_MMAP_THRESHOLD
  30. - /* M_MMAP_THRESHOLD is the request size threshold for using mmap()
  31. - * Default is too big: 256k
  32. - */
  33. - mallopt(M_MMAP_THRESHOLD, 32 * 1024 - 256);
  34. -#endif
  35. -
  36. #if !BB_MMU
  37. /* NOMMU re-exec trick sets high-order bit in first byte of name */
  38. if (argv[0][0] & 0x80) {