Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(506)

Side by Side Diff: third_party/tcmalloc/chromium/src/libc_override.h

Issue 7430007: Merge tcmalloc r111 (perftools v. 1.8) with the chromium/ branch. Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, Google Inc. 1 // Copyright (c) 2011, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // For windows, there are two ways to get tcmalloc. If we're 62 // For windows, there are two ways to get tcmalloc. If we're
63 // patching, then src/windows/patch_function.cc will do the necessary 63 // patching, then src/windows/patch_function.cc will do the necessary
64 // overriding here. Otherwise, we doing the 'redefine' trick, where 64 // overriding here. Otherwise, we doing the 'redefine' trick, where
65 // we remove malloc/new/etc from mscvcrt.dll, and just need to define 65 // we remove malloc/new/etc from mscvcrt.dll, and just need to define
66 // them now. 66 // them now.
67 #if defined(_WIN32) && defined(WIN32_DO_PATCHING) 67 #if defined(_WIN32) && defined(WIN32_DO_PATCHING)
68 void PatchWindowsFunctions(); // in src/windows/patch_function.cc 68 void PatchWindowsFunctions(); // in src/windows/patch_function.cc
69 static void ReplaceSystemAlloc() { PatchWindowsFunctions(); } 69 static void ReplaceSystemAlloc() { PatchWindowsFunctions(); }
70 70
71 #elif defined(_WIN32) && !defined(WIN32_DO_PATCHING) 71 #elif defined(_WIN32) && !defined(WIN32_DO_PATCHING)
72 // On Windows we define the allocation functions in
73 // base/allocator/allocator_shim.cc, so we can't include
74 // libc_override_redefine.h here.
75 // We also need to define ReplaceSystemAlloc() somewhere.
76 #if 0
72 #include "libc_override_redefine.h" 77 #include "libc_override_redefine.h"
78 #else
79 static void ReplaceSystemAlloc() { }
80 #endif
73 81
74 #elif defined(__APPLE__) 82 #elif defined(__APPLE__)
75 #include "libc_override_osx.h" 83 #include "libc_override_osx.h"
76 84
77 #elif defined(__GLIBC__) 85 #elif defined(__GLIBC__)
78 #include "libc_override_glibc.h" 86 #include "libc_override_glibc.h"
79 87
80 // Not all gcc systems necessarily support weak symbols, but all the 88 // Not all gcc systems necessarily support weak symbols, but all the
81 // ones I know of do, so for now just assume they all do. 89 // ones I know of do, so for now just assume they all do.
82 #elif defined(__GNUC__) 90 #elif defined(__GNUC__)
83 #include "libc_override_gcc_and_weak.h" 91 #include "libc_override_gcc_and_weak.h"
84 92
85 #else 93 #else
86 #error Need to add support for your libc/OS here 94 #error Need to add support for your libc/OS here
87 95
88 #endif 96 #endif
89 97
90 #endif // TCMALLOC_LIBC_OVERRIDE_INL_H_ 98 #endif // TCMALLOC_LIBC_OVERRIDE_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698