You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.5 KiB

  1. /*
  2. Copyright 2005-2013 Intel Corporation. All Rights Reserved.
  3. This file is part of Threading Building Blocks.
  4. Threading Building Blocks is free software; you can redistribute it
  5. and/or modify it under the terms of the GNU General Public License
  6. version 2 as published by the Free Software Foundation.
  7. Threading Building Blocks is distributed in the hope that it will be
  8. useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  9. of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with Threading Building Blocks; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  14. As a special exception, you may use this file as part of a free software
  15. library without restriction. Specifically, if other files instantiate
  16. templates or use macros or inline functions from this file, or you compile
  17. this file and link it with other files to produce an executable, this
  18. file does not by itself cause the resulting executable to be covered by
  19. the GNU General Public License. This exception does not however
  20. invalidate any other reasons why the executable file might be covered by
  21. the GNU General Public License.
  22. */
  23. /*
  24. Replacing the standard memory allocation routines in Microsoft* C/C++ RTL
  25. (malloc/free, global new/delete, etc.) with the TBB memory allocator.
  26. Include the following header to a source of any binary which is loaded during
  27. application startup
  28. #include "tbb/tbbmalloc_proxy.h"
  29. or add following parameters to the linker options for the binary which is
  30. loaded during application startup. It can be either exe-file or dll.
  31. For win32
  32. tbbmalloc_proxy.lib /INCLUDE:"___TBB_malloc_proxy"
  33. win64
  34. tbbmalloc_proxy.lib /INCLUDE:"__TBB_malloc_proxy"
  35. */
  36. #ifndef __TBB_tbbmalloc_proxy_H
  37. #define __TBB_tbbmalloc_proxy_H
  38. #if _MSC_VER
  39. #ifdef _DEBUG
  40. #pragma comment(lib, "tbbmalloc_proxy_debug.lib")
  41. #else
  42. #pragma comment(lib, "tbbmalloc_proxy.lib")
  43. #endif
  44. #if defined(_WIN64)
  45. #pragma comment(linker, "/include:__TBB_malloc_proxy")
  46. #else
  47. #pragma comment(linker, "/include:___TBB_malloc_proxy")
  48. #endif
  49. #else
  50. /* Primarily to support MinGW */
  51. extern "C" void __TBB_malloc_proxy();
  52. struct __TBB_malloc_proxy_caller {
  53. __TBB_malloc_proxy_caller() { __TBB_malloc_proxy(); }
  54. } volatile __TBB_malloc_proxy_helper_object;
  55. #endif // _MSC_VER
  56. #endif //__TBB_tbbmalloc_proxy_H