| 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 30 matching lines...) Expand all Loading... |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 // __THROW is defined in glibc systems. It means, counter-intuitively, | 43 // __THROW is defined in glibc systems. It means, counter-intuitively, |
| 44 // "This function will never throw an exception." It's an optional | 44 // "This function will never throw an exception." It's an optional |
| 45 // optimization tool, but we may need to use it to match glibc prototypes. | 45 // optimization tool, but we may need to use it to match glibc prototypes. |
| 46 #ifndef __THROW /* I guess we're not on a glibc system */ | 46 #ifndef __THROW /* I guess we're not on a glibc system */ |
| 47 # define __THROW /* __THROW is just an optimization, so ok to make it "" */ | 47 # define __THROW /* __THROW is just an optimization, so ok to make it "" */ |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 // Define the version number so folks can check against it | 50 // Define the version number so folks can check against it |
| 51 #define TC_VERSION_MAJOR @TC_VERSION_MAJOR@ | 51 #define TC_VERSION_MAJOR 2 |
| 52 #define TC_VERSION_MINOR @TC_VERSION_MINOR@ | 52 #define TC_VERSION_MINOR 0 |
| 53 #define TC_VERSION_PATCH "@TC_VERSION_PATCH@" | 53 #define TC_VERSION_PATCH "" |
| 54 #define TC_VERSION_STRING "google-perftools @TC_VERSION_MAJOR@.@TC_VERSION_MINOR
@@TC_VERSION_PATCH@" | 54 #define TC_VERSION_STRING "gperftools 2.0" |
| 55 | 55 |
| 56 #include <stdlib.h> // for struct mallinfo, if it's defined | 56 #include <stdlib.h> // for struct mallinfo, if it's defined |
| 57 | 57 |
| 58 // Annoying stuff for windows -- makes sure clients can import these functions | 58 // Annoying stuff for windows -- makes sure clients can import these functions |
| 59 #ifndef PERFTOOLS_DLL_DECL | 59 #ifndef PERFTOOLS_DLL_DECL |
| 60 # ifdef _WIN32 | 60 # ifdef _WIN32 |
| 61 # define PERFTOOLS_DLL_DECL __declspec(dllimport) | 61 # define PERFTOOLS_DLL_DECL __declspec(dllimport) |
| 62 # else | 62 # else |
| 63 # define PERFTOOLS_DLL_DECL | 63 # define PERFTOOLS_DLL_DECL |
| 64 # endif | 64 # endif |
| (...skipping 20 matching lines...) Expand all Loading... |
| 85 | 85 |
| 86 PERFTOOLS_DLL_DECL void* tc_memalign(size_t __alignment, | 86 PERFTOOLS_DLL_DECL void* tc_memalign(size_t __alignment, |
| 87 size_t __size) __THROW; | 87 size_t __size) __THROW; |
| 88 PERFTOOLS_DLL_DECL int tc_posix_memalign(void** ptr, | 88 PERFTOOLS_DLL_DECL int tc_posix_memalign(void** ptr, |
| 89 size_t align, size_t size) __THROW; | 89 size_t align, size_t size) __THROW; |
| 90 PERFTOOLS_DLL_DECL void* tc_valloc(size_t __size) __THROW; | 90 PERFTOOLS_DLL_DECL void* tc_valloc(size_t __size) __THROW; |
| 91 PERFTOOLS_DLL_DECL void* tc_pvalloc(size_t __size) __THROW; | 91 PERFTOOLS_DLL_DECL void* tc_pvalloc(size_t __size) __THROW; |
| 92 | 92 |
| 93 PERFTOOLS_DLL_DECL void tc_malloc_stats(void) __THROW; | 93 PERFTOOLS_DLL_DECL void tc_malloc_stats(void) __THROW; |
| 94 PERFTOOLS_DLL_DECL int tc_mallopt(int cmd, int value) __THROW; | 94 PERFTOOLS_DLL_DECL int tc_mallopt(int cmd, int value) __THROW; |
| 95 #if @ac_cv_have_struct_mallinfo@ | 95 #ifdef HAVE_STRUCT_MALLINFO |
| 96 PERFTOOLS_DLL_DECL struct mallinfo tc_mallinfo(void) __THROW; | 96 PERFTOOLS_DLL_DECL struct mallinfo tc_mallinfo(void) __THROW; |
| 97 #endif | 97 #endif |
| 98 | 98 |
| 99 // This is an alias for MallocExtension::instance()->GetAllocatedSize(). | 99 // This is an alias for MallocExtension::instance()->GetAllocatedSize(). |
| 100 // It is equivalent to | 100 // It is equivalent to |
| 101 // OS X: malloc_size() | 101 // OS X: malloc_size() |
| 102 // glibc: malloc_usable_size() | 102 // glibc: malloc_usable_size() |
| 103 // Windows: _msize() | 103 // Windows: _msize() |
| 104 PERFTOOLS_DLL_DECL size_t tc_malloc_size(void* ptr) __THROW; | 104 PERFTOOLS_DLL_DECL size_t tc_malloc_size(void* ptr) __THROW; |
| 105 | 105 |
| 106 #ifdef __cplusplus | 106 #ifdef __cplusplus |
| 107 PERFTOOLS_DLL_DECL int tc_set_new_mode(int flag) __THROW; | 107 PERFTOOLS_DLL_DECL int tc_set_new_mode(int flag) __THROW; |
| 108 PERFTOOLS_DLL_DECL void* tc_new(size_t size); | 108 PERFTOOLS_DLL_DECL void* tc_new(size_t size); |
| 109 PERFTOOLS_DLL_DECL void* tc_new_nothrow(size_t size, | 109 PERFTOOLS_DLL_DECL void* tc_new_nothrow(size_t size, |
| 110 const std::nothrow_t&) __THROW; | 110 const std::nothrow_t&) __THROW; |
| 111 PERFTOOLS_DLL_DECL void tc_delete(void* p) __THROW; | 111 PERFTOOLS_DLL_DECL void tc_delete(void* p) __THROW; |
| 112 PERFTOOLS_DLL_DECL void tc_delete_nothrow(void* p, | 112 PERFTOOLS_DLL_DECL void tc_delete_nothrow(void* p, |
| 113 const std::nothrow_t&) __THROW; | 113 const std::nothrow_t&) __THROW; |
| 114 PERFTOOLS_DLL_DECL void* tc_newarray(size_t size); | 114 PERFTOOLS_DLL_DECL void* tc_newarray(size_t size); |
| 115 PERFTOOLS_DLL_DECL void* tc_newarray_nothrow(size_t size, | 115 PERFTOOLS_DLL_DECL void* tc_newarray_nothrow(size_t size, |
| 116 const std::nothrow_t&) __THROW; | 116 const std::nothrow_t&) __THROW; |
| 117 PERFTOOLS_DLL_DECL void tc_deletearray(void* p) __THROW; | 117 PERFTOOLS_DLL_DECL void tc_deletearray(void* p) __THROW; |
| 118 PERFTOOLS_DLL_DECL void tc_deletearray_nothrow(void* p, | 118 PERFTOOLS_DLL_DECL void tc_deletearray_nothrow(void* p, |
| 119 const std::nothrow_t&) __THROW; | 119 const std::nothrow_t&) __THROW; |
| 120 } | 120 } |
| 121 #endif | 121 #endif |
| 122 | 122 |
| 123 #endif // #ifndef TCMALLOC_TCMALLOC_H_ | 123 #endif // #ifndef TCMALLOC_TCMALLOC_H_ |
| OLD | NEW |