| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add auto-detection of std::align_val_t presence to configure scripts. This
indicates that the compiler supports C++17 operator new/delete overloads
for overaligned types.
- Add auto-detection of -faligned-new compiler option that appeared in gcc 7.
The option allows the compiler to generate calls to the new operators. It is
needed for tests.
- Added overrides for the new operators. The overrides are enabled if the
support for std::align_val_t has been detected. The implementation is mostly
based on the infrastructure used by memalign, which had to be extended to
support being used by C++ operators in addition to C functions. In particular,
the debug version of the library has to distinguish memory allocated by
memalign from that by operator new. The current implementation of sized
overaligned delete operators do not make use of the supplied size argument
except for the debug allocator because it is difficult to calculate the exact
allocation size that was used to allocate memory with alignment. This can be
done in the future.
- Removed forward declaration of std::nothrow_t. This was not portable as
the standard library is not required to provide nothrow_t directly in
namespace std (it could use e.g. an inline namespace within std). The <new>
header needs to be included for std::align_val_t anyway.
- Fixed operator delete[] implementation in libc_override_redefine.h.
- Moved TC_ALIAS definition to the beginning of the file in tcmalloc.cc so that
the macro is defined before its first use in nallocx.
- Added tests to verify the added operators.
[alkondratenko@gmail.com: fixed couple minor warnings, and some
whitespace change]
[alkondratenko@gmail.com: removed addition of TC_ALIAS in debug allocator]
Signed-off-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
|
| |
|
|
|
|
|
| |
Automatically done with:
sed -e 's/\<PERFTOOLS_THROW\>/PERFTOOLS_NOTHROW/g' -i $(git grep -l PERFTOOLS_THROW)
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apparently throw() on functions actually asks compiler to generate code
to detect unexpected exceptions. Which prevents tail calls optimization.
So in order to re-enable this optimization, we simply don't tell
compiler about throw() at all. C++11 noexcept would be even better, but
it is not universally available yet.
So we change to no exception specifications. Which at least for gcc &
clang on Linux (and likely for all ELF platforms, if not just all)
really eliminates all overhead of exceptions.
|
|
|
|
|
| |
This is not necessary and will help adding more headers with
dll-exported functions.
|
| |
|
| |
|
|
|
|
|
| |
Specifically, this commit adds missing fake_stacktrace_scope.cc to msvc
build and removes undef-ing of PERFTOOLS_DLL_DECL by tcmalloc.h.
|
| |
|
|
|
|
|
|
|
| |
We're now using it only when overriding glibc functions (such as malloc
or mmap). In other cases (most importantly in public tcmalloc.h header)
we're doing our own throw() to avoid possible breakage on future glibc
changes.
|
|
|
|
|
|
|
|
|
|
|
|
| |
gcc 5 and clang++-3.7 support sized deallocation from C++14. We are
taking advantage of that by defining sized versions of operator delete.
This is off by default so that if some existing programs that define own
global operator delete without sized variant are not broken by
tcmalloc's sized delete operator.
There is also risk of breaking exiting code that deletes objects using
wrong class (i.e. base class) without having virtual destructors.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is port of corresponding chromium change at:
https://codereview.chromium.org/55333002/
Basic idea is that sometimes apps that use tc_set_new_mode in order to
have C++ out-of-memory handler catch OOMs in malloc, need to invoke
usual malloc that returns 0 on OOM.
That new API is exactly for that. It'll always return NULL on OOM even
if tc_new_mode is set to true.
|
| |
|
|
|
|
| |
git-svn-id: http://gperftools.googlecode.com/svn/trunk@236 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
|
|
|
|
| |
git-svn-id: http://gperftools.googlecode.com/svn/trunk@225 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
|
|
(It's tricky because it's auto-generated from tcmalloc.h.in at
tarball-making time.)
git-svn-id: http://gperftools.googlecode.com/svn/trunk@145 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
|