galloc.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #include <util/system/defaults.h>
  2. #ifndef USE_GOOGLE_ALLOCATOR
  3. #define USE_GOOGLE_ALLOCATOR 1
  4. #endif
  5. #if defined(_MSC_VER) && !defined(__MWERKS__) && !defined (__ICL) && !defined (__COMO__)
  6. #define USE_VISUALCC
  7. #elif defined(__INTEL_COMPILER)
  8. #define USE_INTELCC
  9. #elif defined(__GNUC__)
  10. #define USE_GNUCC
  11. #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
  12. #define USE_SUNCC
  13. #else
  14. //#error your compiler does not supported
  15. #endif
  16. #if defined(USE_INTELCC)
  17. #pragma warning(disable 177)
  18. #pragma warning(disable 869)
  19. #pragma warning(disable 810)
  20. #pragma warning(disable 967)
  21. #pragma warning(disable 1599)
  22. #pragma warning(disable 1469)
  23. #endif
  24. #if defined(_linux_) || defined(_freebsd_)
  25. #define GOOGLE_ALLOCATOR_IS_USABLE
  26. #endif
  27. #if defined(GOOGLE_ALLOCATOR_IS_USABLE) && USE_GOOGLE_ALLOCATOR
  28. #undef NDEBUG
  29. #define NDEBUG
  30. #define HAVE_INTTYPES_H 1
  31. #define HAVE_MMAP 1
  32. #define HAVE_MUNMAP 1
  33. #define HAVE_PTHREAD 1
  34. #define HAVE_SBRK 1
  35. #define HAVE_UNWIND_H 1
  36. #if defined(USE_INTELCC) || defined(USE_GNUCC)
  37. #undef HAVE___ATTRIBUTE__
  38. #define HAVE___ATTRIBUTE__
  39. #endif
  40. #define PRIuS PRISZT
  41. #define LLU PRIu64
  42. #include "malloc_extension.cc"
  43. #include "internal_logging.cc"
  44. #include "system-alloc.cc"
  45. #include "tcmalloc.cc"
  46. #endif