Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 #ifndef __THROW // I guess we're not on a glibc-like system | 46 #ifndef __THROW // I guess we're not on a glibc-like 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 #ifndef __GNUC__ | 50 #ifndef __GNUC__ |
| 51 # error libc_override_gcc_and_weak.h is for gcc distributions only. | 51 # error libc_override_gcc_and_weak.h is for gcc distributions only. |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 #define ALIAS(tc_fn) __attribute__ ((alias (#tc_fn))) | 54 #define ALIAS(tc_fn) __attribute__ ((alias (#tc_fn))) |
| 55 | 55 |
| 56 void* operator new(size_t size) throw (std::bad_alloc) | 56 void* operator new(size_t size) throw (/* std::bad_alloc */) |
|
Peter Beverloo
2013/04/29 17:03:31
It would be helpful to add a comment as to why the
bulach
2013/04/30 18:43:08
Done.
| |
| 57 ALIAS(tc_new); | 57 ALIAS(tc_new); |
| 58 void operator delete(void* p) __THROW | 58 void operator delete(void* p) __THROW |
| 59 ALIAS(tc_delete); | 59 ALIAS(tc_delete); |
| 60 void* operator new[](size_t size) throw (std::bad_alloc) | 60 void* operator new[](size_t size) throw (/* std::bad_alloc */) |
| 61 ALIAS(tc_newarray); | 61 ALIAS(tc_newarray); |
| 62 void operator delete[](void* p) __THROW | 62 void operator delete[](void* p) __THROW |
| 63 ALIAS(tc_deletearray); | 63 ALIAS(tc_deletearray); |
| 64 void* operator new(size_t size, const std::nothrow_t& nt) __THROW | 64 void* operator new(size_t size, const std::nothrow_t& nt) __THROW |
| 65 ALIAS(tc_new_nothrow); | 65 ALIAS(tc_new_nothrow); |
| 66 void* operator new[](size_t size, const std::nothrow_t& nt) __THROW | 66 void* operator new[](size_t size, const std::nothrow_t& nt) __THROW |
| 67 ALIAS(tc_newarray_nothrow); | 67 ALIAS(tc_newarray_nothrow); |
| 68 void operator delete(void* p, const std::nothrow_t& nt) __THROW | 68 void operator delete(void* p, const std::nothrow_t& nt) __THROW |
| 69 ALIAS(tc_delete_nothrow); | 69 ALIAS(tc_delete_nothrow); |
| 70 void operator delete[](void* p, const std::nothrow_t& nt) __THROW | 70 void operator delete[](void* p, const std::nothrow_t& nt) __THROW |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 90 size_t malloc_usable_size(void* p) __THROW ALIAS(tc_malloc_size); | 90 size_t malloc_usable_size(void* p) __THROW ALIAS(tc_malloc_size); |
| 91 } // extern "C" | 91 } // extern "C" |
| 92 | 92 |
| 93 #undef ALIAS | 93 #undef ALIAS |
| 94 | 94 |
| 95 // No need to do anything at tcmalloc-registration time: we do it all | 95 // No need to do anything at tcmalloc-registration time: we do it all |
| 96 // via overriding weak symbols (at link time). | 96 // via overriding weak symbols (at link time). |
| 97 static void ReplaceSystemAlloc() { } | 97 static void ReplaceSystemAlloc() { } |
| 98 | 98 |
| 99 #endif // TCMALLOC_LIBC_OVERRIDE_GCC_AND_WEAK_INL_H_ | 99 #endif // TCMALLOC_LIBC_OVERRIDE_GCC_AND_WEAK_INL_H_ |
| OLD | NEW |