tbbmalloc_proxy.h

00001 /*
00002     Copyright 2005-2009 Intel Corporation.  All Rights Reserved.
00003 
00004     The source code contained or described herein and all documents related
00005     to the source code ("Material") are owned by Intel Corporation or its
00006     suppliers or licensors.  Title to the Material remains with Intel
00007     Corporation or its suppliers and licensors.  The Material is protected
00008     by worldwide copyright laws and treaty provisions.  No part of the
00009     Material may be used, copied, reproduced, modified, published, uploaded,
00010     posted, transmitted, distributed, or disclosed in any way without
00011     Intel's prior express written permission.
00012 
00013     No license under any patent, copyright, trade secret or other
00014     intellectual property right is granted to or conferred upon you by
00015     disclosure or delivery of the Materials, either expressly, by
00016     implication, inducement, estoppel or otherwise.  Any license under such
00017     intellectual property rights must be express and approved by Intel in
00018     writing.
00019 */
00020 
00021 /*
00022 Replacing the standard memory allocation routines in Microsoft* C/C++ RTL 
00023 (malloc/free, global new/delete, etc.) with the TBB memory allocator. 
00024 
00025 Include the following header to a source of any binary which is loaded during 
00026 application startup
00027 
00028 #include "tbb/tbbmalloc_proxy.h"
00029 
00030 or add following parameters to the linker options for the binary which is 
00031 loaded during application startup. It can be either exe-file or dll.
00032 
00033 For win32
00034 tbbmalloc_proxy.lib /INCLUDE:"___TBB_malloc_proxy"
00035 win64
00036 tbbmalloc_proxy.lib /INCLUDE:"__TBB_malloc_proxy"
00037 */
00038 
00039 #ifndef __TBB_tbbmalloc_proxy_H
00040 #define __TBB_tbbmalloc_proxy_H
00041 
00042 #if _MSC_VER
00043 
00044 #ifdef _DEBUG
00045     #pragma comment(lib, "tbbmalloc_proxy_debug.lib")
00046 #else
00047     #pragma comment(lib, "tbbmalloc_proxy.lib")
00048 #endif
00049 
00050 #if defined(_WIN64)
00051     #pragma comment(linker, "/include:__TBB_malloc_proxy")
00052 #else
00053     #pragma comment(linker, "/include:___TBB_malloc_proxy")
00054 #endif
00055 
00056 #else
00057 /* Primarily to support MinGW */
00058 
00059 extern "C" void __TBB_malloc_proxy();
00060 struct __TBB_malloc_proxy_caller {
00061     __TBB_malloc_proxy_caller() { __TBB_malloc_proxy(); }
00062 } volatile __TBB_malloc_proxy_helper_object;
00063 
00064 #endif // _MSC_VER
00065 
00066 #endif //__TBB_tbbmalloc_proxy_H

Copyright © 2005-2009 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.