tcmalloc.patch 1.0 KB

1234567891011121314151617181920212223
  1. --- a/vendor/google-perftools-1.2/src/tcmalloc.cc 2011-02-24 02:09:12.000000000 -0800
  2. +++ b/vendor/google-perftools-1.2/src/tcmalloc.cc 2011-11-11 12:46:13.704738476 -0800
  3. @@ -137,6 +137,13 @@
  4. # define WIN32_DO_PATCHING 1
  5. #endif
  6. +// GLibc 2.14+ requires the hook functions be declared volatile, based on the value of the
  7. +// define __MALLOC_HOOK_VOLATILE. For compatibility with older/non-GLibc implementations,
  8. +// provide an empty definition.
  9. +#if !defined(__MALLOC_HOOK_VOLATILE)
  10. +#define __MALLOC_HOOK_VOLATILE
  11. +#endif
  12. +
  13. using STL_NAMESPACE::max;
  14. using STL_NAMESPACE::numeric_limits;
  15. using STL_NAMESPACE::vector;
  16. @@ -1669,5 +1676,5 @@ static void *MemalignOverride(size_t align, size_t size, const void *caller)
  17. MallocHook::InvokeNewHook(result, size);
  18. return result;
  19. }
  20. -void *(*__memalign_hook)(size_t, size_t, const void *) = MemalignOverride;
  21. +void *(*__MALLOC_HOOK_VOLATILE __memalign_hook)(size_t, size_t, const void *) = MemalignOverride;
  22. #endif // #ifndef TCMALLOC_FOR_DEBUGALLOCATION