| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_PROCESS_MEMORY_H_ | 5 #ifndef BASE_PROCESS_MEMORY_H_ |
| 6 #define BASE_PROCESS_MEMORY_H_ | 6 #define BASE_PROCESS_MEMORY_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 | 12 |
| 13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
| 14 #include <windows.h> | 14 #include <windows.h> |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 #ifdef PVALLOC_AVAILABLE |
| 18 // Build config explicitly tells us whether or not pvalloc is available. |
| 19 #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC) |
| 20 #define PVALLOC_AVAILABLE 1 |
| 21 #else |
| 22 #define PVALLOC_AVAILABLE 0 |
| 23 #endif |
| 24 |
| 17 namespace base { | 25 namespace base { |
| 18 | 26 |
| 19 // Enables low fragmentation heap (LFH) for every heaps of this process. This | 27 // Enables low fragmentation heap (LFH) for every heaps of this process. This |
| 20 // won't have any effect on heaps created after this function call. It will not | 28 // won't have any effect on heaps created after this function call. It will not |
| 21 // modify data allocated in the heaps before calling this function. So it is | 29 // modify data allocated in the heaps before calling this function. So it is |
| 22 // better to call this function early in initialization and again before | 30 // better to call this function early in initialization and again before |
| 23 // entering the main loop. | 31 // entering the main loop. |
| 24 // Note: Returns true on Windows 2000 without doing anything. | 32 // Note: Returns true on Windows 2000 without doing anything. |
| 25 BASE_EXPORT bool EnableLowFragmentationHeap(); | 33 BASE_EXPORT bool EnableLowFragmentationHeap(); |
| 26 | 34 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // | 69 // |
| 62 // IF YOU USE THIS WITHOUT CONSULTING YOUR FRIENDLY OSX DEVELOPER, | 70 // IF YOU USE THIS WITHOUT CONSULTING YOUR FRIENDLY OSX DEVELOPER, |
| 63 // YOUR CODE IS LIKELY TO BE REVERTED. THANK YOU. | 71 // YOUR CODE IS LIKELY TO BE REVERTED. THANK YOU. |
| 64 BASE_EXPORT void* UncheckedMalloc(size_t size); | 72 BASE_EXPORT void* UncheckedMalloc(size_t size); |
| 65 BASE_EXPORT void* UncheckedCalloc(size_t num_items, size_t size); | 73 BASE_EXPORT void* UncheckedCalloc(size_t num_items, size_t size); |
| 66 #endif // defined(OS_MACOSX) | 74 #endif // defined(OS_MACOSX) |
| 67 | 75 |
| 68 } // namespace base | 76 } // namespace base |
| 69 | 77 |
| 70 #endif // BASE_PROCESS_MEMORY_H_ | 78 #endif // BASE_PROCESS_MEMORY_H_ |
| OLD | NEW |