OLD | NEW |
1 /* Copyright (c) 2003, Google Inc. | 1 /* Copyright (c) 2003, 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 PERFTOOLS_DLL_DECL struct mallinfo tc_mallinfo(void) __THROW; | 106 PERFTOOLS_DLL_DECL struct mallinfo tc_mallinfo(void) __THROW; |
107 #endif | 107 #endif |
108 | 108 |
109 // This is an alias for MallocExtension::instance()->GetAllocatedSize(). | 109 // This is an alias for MallocExtension::instance()->GetAllocatedSize(). |
110 // It is equivalent to | 110 // It is equivalent to |
111 // OS X: malloc_size() | 111 // OS X: malloc_size() |
112 // glibc: malloc_usable_size() | 112 // glibc: malloc_usable_size() |
113 // Windows: _msize() | 113 // Windows: _msize() |
114 PERFTOOLS_DLL_DECL size_t tc_malloc_size(void* ptr) __THROW; | 114 PERFTOOLS_DLL_DECL size_t tc_malloc_size(void* ptr) __THROW; |
115 | 115 |
| 116 // Does not call std::new_handler if the allocation fails but returns NULL. |
| 117 // This is for callers that want to handle this situation in a special way. |
| 118 PERFTOOLS_DLL_DECL void* tc_malloc_skip_new_handler(size_t size) __THROW; |
| 119 |
116 #ifdef __cplusplus | 120 #ifdef __cplusplus |
117 PERFTOOLS_DLL_DECL int tc_set_new_mode(int flag) __THROW; | 121 PERFTOOLS_DLL_DECL int tc_set_new_mode(int flag) __THROW; |
118 PERFTOOLS_DLL_DECL void* tc_new(size_t size); | 122 PERFTOOLS_DLL_DECL void* tc_new(size_t size); |
119 PERFTOOLS_DLL_DECL void* tc_new_nothrow(size_t size, | 123 PERFTOOLS_DLL_DECL void* tc_new_nothrow(size_t size, |
120 const std::nothrow_t&) __THROW; | 124 const std::nothrow_t&) __THROW; |
121 PERFTOOLS_DLL_DECL void tc_delete(void* p) __THROW; | 125 PERFTOOLS_DLL_DECL void tc_delete(void* p) __THROW; |
122 PERFTOOLS_DLL_DECL void tc_delete_nothrow(void* p, | 126 PERFTOOLS_DLL_DECL void tc_delete_nothrow(void* p, |
123 const std::nothrow_t&) __THROW; | 127 const std::nothrow_t&) __THROW; |
124 PERFTOOLS_DLL_DECL void* tc_newarray(size_t size); | 128 PERFTOOLS_DLL_DECL void* tc_newarray(size_t size); |
125 PERFTOOLS_DLL_DECL void* tc_newarray_nothrow(size_t size, | 129 PERFTOOLS_DLL_DECL void* tc_newarray_nothrow(size_t size, |
126 const std::nothrow_t&) __THROW; | 130 const std::nothrow_t&) __THROW; |
127 PERFTOOLS_DLL_DECL void tc_deletearray(void* p) __THROW; | 131 PERFTOOLS_DLL_DECL void tc_deletearray(void* p) __THROW; |
128 PERFTOOLS_DLL_DECL void tc_deletearray_nothrow(void* p, | 132 PERFTOOLS_DLL_DECL void tc_deletearray_nothrow(void* p, |
129 const std::nothrow_t&) __THROW; | 133 const std::nothrow_t&) __THROW; |
130 } | 134 } |
131 #endif | 135 #endif |
132 | 136 |
133 #endif // #ifndef TCMALLOC_TCMALLOC_H_ | 137 #endif // #ifndef TCMALLOC_TCMALLOC_H_ |
OLD | NEW |