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