summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* implemented (disabled by default) sized delete supportwip-from-alk-for-reviewAliaksey Kandratsenka2015-10-057-10/+59
| | | | | | | | | | | | 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.
* pass -fsized-deallocation to gcc 5Aliaksey Kandratsenka2015-10-052-0/+16
| | | | Otherwise it gives warning for declaration of sized delete operator.
* implemented sized free support via tc_free_sizedAliaksey Kandratsenka2015-10-056-27/+66
|
* speedup free code path by dropping "fast path allowed check"Aliaksey Kandratsenka2015-10-051-3/+2
|
* added SizeMap::MaybeSizeClassAliaksey Kandratsenka2015-10-051-4/+25
| | | | | Because it allows us to first check for smaller sizes, which is most likely.
* slightly faster GetCacheIfPresentAliaksey Kandratsenka2015-10-051-0/+2
|
* tell compiler that non-empty hooks are unlikelyAliaksey Kandratsenka2015-10-051-2/+4
|
* correctly test for -Wno-unused-result supportAliaksey Kandratsenka2015-10-051-1/+6
| | | | | | | | gcc is only giving warning for unknown -Wno-XXX flags so test never fails on gcc even if -Wno-XXX is not supported. By using -Wunused-result we're able to test if gcc actually supports it. This fixes issue #703.
* fixed clang warning about shifting negative valuesAliaksey Kandratsenka2015-10-051-1/+1
|
* drop cycleclockAliaksey Kandratsenka2015-10-056-184/+0
|
* amputate unportable and unused stuff from sysinfoAliaksey Kandratsenka2015-10-053-308/+12
| | | | | | | | | | | | | | | | | | We still check number of cpus in the system (in spinlock code), but old code was built under assumption of "no calls malloc" which is not needed in tcmalloc. Which caused it to be far more complicated than necessary (parsing procfs files, ifdefs for different OSes and arch-es). Also we don't need clock cycle frequency measurement. So I've removed all complexity of ald code and NumCPUs function and replaced it with GetSystemCPUsCount which is straightforward and portable call to sysconf. Renaming of cpus count function was made so that any further code that we might port from Google that depends on old semantics of NumCPUs will be detected at compile time. And has to be inspected for whether it really needs that semantics.
* amputated wait_cycles accounting in spinlocksAliaksey Kandratsenka2015-10-052-65/+20
| | | | | This is not needed and pulls in CycleClock dependency that lowers code portability.
* drop cycleclock reference in ThreadCacheAliaksey Kandratsenka2015-10-051-1/+0
|
* dropped unused and unsupported synchronization profiling facilityAliaksey Kandratsenka2015-10-053-71/+0
| | | | | | | | Spinlock usage of cycle counter is due do tracking of time it's spent waiting for lock. But this tracking is only useful we actually have synchronization profiling working, which dont have. Thus I'm dropping calls to this facility with eye towards further removal of cycle clock usage.
* dropped unused SpinLockWait functionAliaksey Kandratsenka2015-10-053-35/+1
|
* avoid checking for dup. entries on empty backtraceAliaksey Kandratsenka2015-10-051-1/+1
| | | | | This might fix issue #721. But it is right thing to do regardless. Since if depth is 0 we'll be reading random "garbage" on the stack.
* fixed compiler warning in memory_region_map.ccAliaksey Kandratsenka2015-10-051-1/+3
|
* Don't link libtcmalloc_minimal.so to libpthread.soAliaksey Kandratsenka2015-10-054-11/+32
| | | | | | | | | So that LD_PRELOAD-ing doesn't force loading libpthread.so which may slow down some single-threaded apps. tcmalloc already has maybe_threads facility that can detect if libpthread.so is loaded (via weak symbols) and provide 'simulations' of some pthread functions that tcmalloc needs.
* Check if _MSC_VER is defined to avoid warningsFredrik Mellbin2015-10-031-2/+2
|
* Make default config.h work with VS2015Fredrik Mellbin2015-10-031-0/+8
|
* Ensure ThreadCache objects are CACHELINE_ALIGNED.Dair Grant2015-10-033-10/+9
|
* unbreak TestErrno againAliaksey Kandratsenka2015-09-261-1/+1
| | | | | Somehow in previous commit I managed to break assignment of memalign result to variable being tested. Luckily gcc gave me warning.
* don't try to test memalign on windowsAliaksey Kandratsenka2015-09-261-4/+7
| | | | This unbreaks tcmalloc_unittest.cc on windows.
* Merge pull request #717 from myrsloik/masterAliaksey Kandratsenka (aka Aliaksei Kandratsenka)2015-09-261-0/+11
|\ | | | | Use correct mangled new and delete symbols on windows x64
| * Use correct mangled new and delete symbols on windows x64Fredrik Mellbin2015-09-241-0/+11
|/
* Don't discard curl options if timeout is not defined.fdeweerdt2015-09-191-1/+1
| | | | | | | | | | | | | | Editing the options passed to curl via 'my @URL_FETCHER = ("curl", "-s");' (in particular to add a -k to ignore self signed certs) fails for some invocations of curl. In FetchDynamicProfile, 'my @fetcher = AddFetchTimeout($fetch_timeout, @URL_FETCHER);' ends up being just 'curl' if timeout is not defined. This happens because AddFetchTimeout doesn't retrieve all the arguments from the caller. [alk@tut.by: updated commit message] Signed-off-by: Aliaksey Kandratsenka <alk@tut.by>
* help clang with inlining important fast-path functionsAliaksey Kandratsenka2015-08-022-14/+26
| | | | | | | | | | | | Clang's recent focus on code size doesn't help us in malloc fast-path because somehow clang completely ignores inline directives. In order to help clang generate code that was actually intended by original authors, we're adding always_inline attribute to key fast-path functions. Clang also guessed likely branch "wrong" in couple places. Which is now addressed by UNLIKELY declarations there.
* moved do_mallor_or_cpp_alloc in better placeAliaksey Kandratsenka2015-08-021-15/+13
|
* always set errno to ENOMEM on OOM condition and in single placeAliaksey Kandratsenka2015-08-023-47/+28
| | | | | | | | | | | While standards do not require us to set errno to ENOMEM in certain places (like posix_memalign), existing code may sometimes set it (i.e. because mmap or sbrk couldn't get memory from kernel) anyways. And from my reading of glibc, it's malloc is doing more or less same by just always setting ENOMEM on OOM condition. This commit also eliminates some functions (XXX_no_errno) that are not needed anymore.
* deal with OOM handling in one place and prior to returning resultAliaksey Kandratsenka2015-08-022-181/+161
| | | | | | | | | This commit removes 4 (four!) duplicates of C++ OOM handling. And introduces one helper for that. Other change is that malloc doesn't have to check tc_new_mode anymore until it _actually_ deals with OOM condition. Which shaves off couple instructions from fast-path.
* added tcmalloc_unittest path with TCMALLOC_HEAP_LIMIT_MB=512Aliaksey Kandratsenka2015-08-021-0/+4
| | | | I.e. so that we can exercise "voluntary" OOM conditions better.
* added test on errno = ENOMEM on out of memoryAliaksey Kandratsenka2015-08-021-0/+18
|
* unbreak heap-profiler-unittest on gcc 5Aliaksey Kandratsenka2015-08-021-0/+4
| | | | | | | | | | | gcc 5 has got nice new optimization (-fipa-icf) which merges identical functions into one. And that causes heap-profiler_unittest to fail since it expects to see both Allocate and Allocate2 in heap profiles. And smart GCC detects that they are same function and makes one function out of two and thus breaks this test. New code simply adds (disabled) logging calls to make those functions non-identical.
* unbreak heap_checker_unittest on gcc 5Aliaksey Kandratsenka2015-08-021-0/+12
| | | | | | GCC 5 ended up too smart and optimized out assignment of allocated block to global variable. Which caused test to fail since it triggered unexpected "leak".
* dropped support for PREANSINEW define which nobody needs anymoreAliaksey Kandratsenka2015-08-022-16/+0
|
* added trivial malloc fast-path benchmarkAliaksey Kandratsenka2015-08-023-0/+111
| | | | | | While this is not good representation of real-world production malloc behavior, it is representative of length (instruction-wise and well as cycle-wise) of fast-path. So this is better than nothing.
* issue-699: Free list on error pathsTom Conerly2015-08-011-2/+8
|
* issue-702: correctly declare arg-less functions in profiler.hAliaksey Kandratsenka2015-08-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is patch by user mitchblank. From his words: The problem is pretty simple. Ancient C code allowed declarations without argument prototypes, i.e. int foo(); For compatibility this is still accepted. If you want to declare a function with zero prototypes the correct way to do it is: int foo(void); C++ also accepts this syntax, but it's not needed there. Normally compilers still accept the old-style entries, but with sufficient warning flags gcc will complain about them. It is good for header files to have the explicit "void" argument so all compilers are kept happy. I'm attaching a simple patch to add the "void" parameter to that file. I haven't checked if other headers have the same problem (I'm just using the profiler at the moment) <end of quote> In fact "int foo()" means "foo accepts any args" and we really want "foo has no args". For which int foo (void) is right declaration.
* issue-693: enable futex usage on armAliaksey Kandratsenka2015-06-272-10/+6
| | | | This patch was contributed by user spotrh.
* issue-693: convert sys_futex to it's 6-arg formAliaksey Kandratsenka2015-06-271-2/+4
| | | | | | | Because sys_futex actually takes 6 args in more recent kernels (even though last two args are unused for FUTEX_{WAKE,WAIT}. This is patch contributed by user spotrh.
* issue-695: implementated TCMALLOC_TRACE_FILE variableAliaksey Kandratsenka2015-06-271-4/+16
| | | | | | | This is contributed by Paolo Bonzini. This commit adds TCMALLOC_TRACE_FILE environment variable, which if defined overrides location of malloc trace file.
* Add empty virtual destructor to class with virtual methods.Brian Silverman2015-06-161-0/+1
| | | | | | | | | | | | | | Clang 3.5 has a warning about deleting objects with virtual methods through non-virtual destructors which was triggered. I'm not sure whether this actually creates any undefined or otherwise incorrect behavior, but it seems like a good thing to fix regardless. Example compiler warning: third_party/gperftools/src/tests/profile-handler_unittest.cc:282:5: error: delete called on '(anonymous namespace)::BusyThread' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] delete busy_worker_; ^
* Add support for CPUPROFILE_TIMER_SIGNAL environment variable.Patrick LoPresti2015-05-302-23/+40
| | | | | | | | Which both enables per-thread timers and allows the signal number for the timer to be selected. [alk@tut.by: reformatted commit message for subject line length] Signed-off-by: Aliaksey Kandratsenka <alk@tut.by>
* Add "ARMv8-A" to the supporting list of ARM architecture.Milton Chiang2015-05-231-1/+6
|
* include time.h for struct timespec on Visual Studio 2015Aliaksey Kandratsenka2015-05-091-0/+5
| | | | This patch was submitted by user wmamrak.
* hook mi_force_{un,}lock on OSX instead of pthread_atforkAliaksey Kandratsenka2015-05-092-4/+9
| | | | | | This is patch by Anton Samokhvalov. Apparently it helps with locking around forking on OSX.
* Clarify that only tcmalloc_minimal is supported on Windows.Angus Gratton2015-05-092-13/+17
|
* issue-683: fix compile error in clang with -m32 and 64-bit off_tAliaksey Kandratsenka2015-05-031-1/+1
|
* fix typo in PrintAvailability codeAliaksey Kandratsenka2015-04-111-1/+1
| | | | This is patch contributed by user ssubotin.
* Add support for printing collapsed stacks for generating flame graphs.Matt Cross2015-03-261-0/+52
|