| 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" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // These functions may still crash on OOM when running under memory tools, | 70 // These functions may still crash on OOM when running under memory tools, |
| 71 // specifically ASan and other sanitizers. | 71 // specifically ASan and other sanitizers. |
| 72 // Return value tells whether the allocation succeeded. If it fails |result| is | 72 // Return value tells whether the allocation succeeded. If it fails |result| is |
| 73 // set to NULL, otherwise it holds the memory address. | 73 // set to NULL, otherwise it holds the memory address. |
| 74 BASE_EXPORT WARN_UNUSED_RESULT bool UncheckedMalloc(size_t size, | 74 BASE_EXPORT WARN_UNUSED_RESULT bool UncheckedMalloc(size_t size, |
| 75 void** result); | 75 void** result); |
| 76 BASE_EXPORT WARN_UNUSED_RESULT bool UncheckedCalloc(size_t num_items, | 76 BASE_EXPORT WARN_UNUSED_RESULT bool UncheckedCalloc(size_t num_items, |
| 77 size_t size, | 77 size_t size, |
| 78 void** result); | 78 void** result); |
| 79 | 79 |
| 80 // TODO(b.kelemen): make Skia use the new interface and remove these. | |
| 81 #if defined(OS_MACOSX) | |
| 82 BASE_EXPORT void* UncheckedMalloc(size_t size); | |
| 83 BASE_EXPORT void* UncheckedCalloc(size_t num_items, size_t size); | |
| 84 #endif | |
| 85 | |
| 86 } // namespace base | 80 } // namespace base |
| 87 | 81 |
| 88 #endif // BASE_PROCESS_MEMORY_H_ | 82 #endif // BASE_PROCESS_MEMORY_H_ |
| OLD | NEW |