Commit Graph

185 Commits

Author SHA1 Message Date
Aliaksey Kandratsenka
89b163a088 added .gitignore 2013-08-04 18:27:07 +03:00
alkondratenko@gmail.com
18fbc316ee Fix a C++11 error.
This merges patch by Nico Weber.

New clang versions complain in C++11 mode that:

error: cannot initialize a variable of type 'void *' with an rvalue of type 'uintptr_t' (aka 'unsigned long')

This same change was done for the google-internal version of tcmalloc too.

Reviewed-at: https://codereview.appspot.com/12132043



git-svn-id: http://gperftools.googlecode.com/svn/trunk@238 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-31 04:02:19 +00:00
alkondratenko@gmail.com
674fcd94a8 bump version to 2.1
git-svn-id: http://gperftools.googlecode.com/svn/trunk@236 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-30 09:14:20 +00:00
alkondratenko@gmail.com
805a660193 issue-559: don't setup fork handler in InitStaticVars
Because on OSX it calls malloc which leads to deadlock.

Given that we don't really need that fork handler _that_ early, it's
fine to change it to normal static initializer



git-svn-id: http://gperftools.googlecode.com/svn/trunk@235 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-30 08:30:45 +00:00
alkondratenko@gmail.com
c583a5babb issue-559: don't depend on sighandler_t
Which is not available on OSX.

I've also fixed style around this place.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@234 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-30 08:30:19 +00:00
alkondratenko@gmail.com
1af20041bf issue-559: AtomicWord xxx_AtomicExchange are all inline
Otherwise OSX correctly complains about duplicate definitions



git-svn-id: http://gperftools.googlecode.com/svn/trunk@233 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-30 08:29:46 +00:00
alkondratenko@gmail.com
7a9c4e075f issue-556: update windows PACKAGE_{VERSION,STRING}
git-svn-id: http://gperftools.googlecode.com/svn/trunk@232 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-26 19:36:08 +00:00
alkondratenko@gmail.com
11d46f0aac issue-556: dll-export getpagesize
Because page_heap_test needs this.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@231 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-26 19:35:38 +00:00
alkondratenko@gmail.com
6d4ad4428b issue-556: drop malloc limit at the end of page_heap_test
Which otherwise causes somewhat weird stack overflow on release
windows builds.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@230 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-26 19:35:20 +00:00
alkondratenko@gmail.com
be54c3f3ed issue-556: dll-export TCMalloc_System{Alloc,Release}
because page_heap_test is using this stuff



git-svn-id: http://gperftools.googlecode.com/svn/trunk@229 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-26 19:34:54 +00:00
alkondratenko@gmail.com
e3716145cb issue-552: Fix page_heap_test for system with different page size
This is patch by Adhemerval Zanella.

PowerPC uses 64K page size instead of 4k for x86 and x86_64. It makes the
page_heap_test fails because the following test:

 static bool HaveSystemRelease =
    TCMalloc_SystemRelease(TCMalloc_SystemAlloc(kPageSize, NULL, 0), kPageSize);

will always fail if kPageSize is less than getpagesize() (the default
configuration).

The following patch fixes it by trying to allocate/deallocate an entire
page instead.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@228 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-26 18:19:05 +00:00
alkondratenko@gmail.com
f45133e75c issue-553: Fix syscall wrapper for PowerPC
This is patch by Adhemerval Zanella.

* src/stacktrace_powerpc-inl.h: It is just a cleanup for the stacktrace
  functions for PowerPC. The idea is to simplify the code.
* src/tests/heap-checker_unittest.cc: Handles the PPC64 function descriptor
  correctly in malloc tracers. Different from other architecture, for PPC64
  the address returned in function pointers are the ODP entry, not the
  symbol address in .text segment. This leads the comparison bogus, since
  it will compare a ODP entry with a .text address.
* src/heap-checker.cc: Add support for PPC in ptrace.
* src/base/elfcore.h: Likewise.
* src/base/linuxthreads.cc: Fix the thread creation using the clone wrapper.
* src/base/linux_syscall_support.h: Various fixes for PPC32 and PPC64:
  fixes the kernel_stat[64] struct layout, and sys_clone and sys_socket
  implementation.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@227 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-26 18:04:03 +00:00
alkondratenko@gmail.com
ee2bf09713 updated NEWS and packages/ for 2.1rc
git-svn-id: http://gperftools.googlecode.com/svn/trunk@226 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-20 21:37:26 +00:00
alkondratenko@gmail.com
60ab178aeb bump version number for 2.1rc
git-svn-id: http://gperftools.googlecode.com/svn/trunk@225 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-20 21:37:01 +00:00
alkondratenko@gmail.com
7c2aa2f7c2 issue-546: fixed return type of Release_AtomicExchange on arm6+
git-svn-id: http://gperftools.googlecode.com/svn/trunk@224 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-20 21:35:56 +00:00
alkondratenko@gmail.com
d8e12e94ea issue-549: handle most recent mingw that has sleep and nanosleep
I.e. we have to check their presence in configure and in case of their
presence we have to avoid re-defining then in window's port.h



git-svn-id: http://gperftools.googlecode.com/svn/trunk@223 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-20 21:35:14 +00:00
alkondratenko@gmail.com
ac354636de issue-550: remove config.h.in
Which is autoconf product and thus is not needed in source repository



git-svn-id: http://gperftools.googlecode.com/svn/trunk@222 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-14 04:19:02 +00:00
alkondratenko@gmail.com
e54971d586 issue-534: fixed a number of gcc warnings
This applies patch from Adhemerval Zanella.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@221 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-06 21:54:34 +00:00
alkondratenko@gmail.com
7dd038d7c5 issue-545: corrected README for CPUPROFILE_FREQUENCY variable
Applied patch by Mikhail Veltishchev



git-svn-id: http://gperftools.googlecode.com/svn/trunk@220 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-06 20:48:18 +00:00
alkondratenko@gmail.com
a833a146b7 issue-528: fixed spelling
This simply applies patch by Lajos Veres



git-svn-id: http://gperftools.googlecode.com/svn/trunk@219 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-06 20:46:50 +00:00
alkondratenko@gmail.com
205abf1e7c issue-518: add support for x32 ABI to linux_syscall_support.h
As pointed out in the ticket this is taken from chromium review system
here: https://codereview.chromium.org/13648012



git-svn-id: http://gperftools.googlecode.com/svn/trunk@218 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-12 19:15:13 +00:00
alkondratenko@gmail.com
376a3107aa issue-368: allocate enough bytes for large metadata allocations
During issue-368 review it was correctly pointed out then in place
where I compare metadata allocation size to threshold I should pass
that size down to TCMalloc_SystemAlloc instead of threshold.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@217 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-07 22:28:05 +00:00
alkondratenko@gmail.com
58d39a1b21 issue-368: added missing large_heap_fragmentation_unittest.cc
git-svn-id: http://gperftools.googlecode.com/svn/trunk@216 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-07 22:23:37 +00:00
alkondratenko@gmail.com
c45bb7d603 issue-511: fixed negative offset handling for conditional jumps
While doing and testing issue-511 I've found one subtle bug which is
incorrect handling of short offsets. They are defined to be signed but
previous code used unsigned char for them which caused negative
offsets to look like larger positive offsets. Fix is trivial.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@215 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-07 19:22:45 +00:00
alkondratenko@gmail.com
3567b1701a issue-511: recognise rex.w jmpq *<literal>(%rip) as iat jump
Apparently Windows Server 2012 (and presumably windows 8) now has this
form of iat jump. Which is quite useless (rex.w is according to my
understanding is not needed at all) but because of rex.w our code to
recognize jumps like that didn't work.

Fix is just skip this prefix.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@214 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-07 19:15:35 +00:00
alkondratenko@gmail.com
7fcb5ac069 issue-511: implemented rel8 jump patching
I've found that Visual Studio 2012 release 32-bit C runtime library
patching fails because array new has rel8 jmp which previous code
could not handle.

Implementation is largely copied from conditional jumps handling code.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@213 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-07 19:13:29 +00:00
alkondratenko@gmail.com
8cb4086a0a issue-368: test that we don't fragment large spans too badly
This adds unit test that does essentially same things as code to
reproduce bug in
https://code.google.com/p/gperftools/issues/detail?id=368




git-svn-id: http://gperftools.googlecode.com/svn/trunk@212 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-06 19:50:59 +00:00
alkondratenko@gmail.com
f25ac4421f issue-{368,443}: allocate metadata in big batches
It uses same approach as PageHeapAllocator. Namely allocates big chunk
which is then used to satisfy smaller allocations.

In issue-443 gradual heap grows causes old code that allocates
metadata in smaller pieces and thus more frequently to fragment the
heap. It's also causing most of 368 heap fragmentation too.

New code allocates 8 megs of address space at once for metadata
allocations. Most OSes will allocate actual memory only when
corresponding pages are touched. Thus this change should not cause
increased memory usage.

I've also made sure metadata is always properly aligned in case we
ever allocate something that breaks natural alignment. E.g. strings.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@211 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-06 19:50:23 +00:00
alkondratenko@gmail.com
4fd762cead issue-368: unmap free spans and retry before growing heap
Because unmapped spans are not coalesced with normal spans it's
possible that we indeed have a large enough free span, but we fail to
see that because we always consider unmapped and normal spans
separately. That behavior is more likely for larger spans.

In order to protect programs that grow heap frequently and by small
amounts from much more frequent minor page faults, there's limit of
running that force pages unmap path once per 128 megs of heap growth.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@210 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-06 19:49:48 +00:00
alkondratenko@gmail.com
99fe9944de issue-510: remove duplicate arm #elif
git-svn-id: http://gperftools.googlecode.com/svn/trunk@209 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-04-01 05:32:22 +00:00
alkondratenko@gmail.com
6354e2c8cd issue-506: fixed bogus unit test failure
Looks like my version of GCC is aware that free(malloc(X)) is a
no-op. So it optimizes that away completely ignoring simple fact that
we're observing malloc hooks invocations. By adding check that malloc
succeeded we force gcc to actually preserve that malloc call.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@208 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:24:49 +00:00
alkondratenko@gmail.com
7896dcb9db issue-504: disable tls on mingw
Which is known to fail.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@207 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:16:47 +00:00
alkondratenko@gmail.com
8bf4522aa5 issue-504: do not define HAVE_MMAP on mingw
Because, clearly, windows doesn't have one



git-svn-id: http://gperftools.googlecode.com/svn/trunk@206 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:15:46 +00:00
alkondratenko@gmail.com
9c24d255cd issue-504: add AM_LDFLAGS to all *_la targets
Because automake will not automatically add AM_LDFLAGS if there's
per-target LDFLAGS. See their good info manual.

This fixes .dll compilation of tcmalloc



git-svn-id: http://gperftools.googlecode.com/svn/trunk@205 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:15:23 +00:00
alkondratenko@gmail.com
a2275fc6b4 issue-504: don't try to typedef pid_t on mingw
Because recent mingws (more then few years ago seemingly) do that
already.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@204 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:14:18 +00:00
alkondratenko@gmail.com
f00977533d issue-504: use gcc inline assembly atomic ops on mingw
Because those are well tested and can be trusted



git-svn-id: http://gperftools.googlecode.com/svn/trunk@203 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:13:53 +00:00
alkondratenko@gmail.com
34cdd6821b issue-504: use lowercase windows includes for mingw x-compilation
I.e. so that I can build tcmalloc.dll using comfortable environment of
my GNU/Linux box and without having to touch actual windows box or VM.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@202 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:13:13 +00:00
alkondratenko@gmail.com
0971d80d0e issue-503: updated svn:ignore to ignore generated files
git-svn-id: http://gperftools.googlecode.com/svn/trunk@201 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 18:35:16 +00:00
alkondratenko@gmail.com
05b100d9d4 issue-503: removed checked in configure and other auto* products
So that it's easier to contribute and review contributions.

People wishing to build gperftools from svn checkout should run
autogen.sh first which will create those files and then ./configure &&
make as usual

INSTALL file has updated instructions too.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@200 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 18:32:05 +00:00
alkondratenko@gmail.com
dcf55b976f issue-503: recover original INSTALL file
That was accidently overwritten by autotools files update in r196



git-svn-id: http://gperftools.googlecode.com/svn/trunk@199 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 18:29:00 +00:00
chappedm@gmail.com
5037f687d1 issue-425: Fixed tcmalloc unittest crashes for windows builds
Missing use of volatile was causing vs2010 to perform unwanted
optimization resulting in the crash. See issue for more details.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@198 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 01:35:37 +00:00
chappedm@gmail.com
beb78cc05b issue-493: Fix for building against ARM targets
gperftools was failing to build for arm targets for the following reasons:
1. Some ARMv7 instructions used when the target is ARMv6 so those fail to assemble
2. The cache line length is undefined for ARM architectures


git-svn-id: http://gperftools.googlecode.com/svn/trunk@197 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 00:23:03 +00:00
chappedm@gmail.com
bd3b3a7e9a issue-496: Fixes an issue where tcmalloc might deadlock in a thread calling fork
tcmalloc contained a bug where some internal locks were left in a undefined state
between fork, leaving the child process in a deadlock state. This patch fixes the
issue by introducing stricter locking between the parent nd child while forking.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@196 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-10 20:17:21 +00:00
chappedm@gmail.com
560ca8650c issue-491: Significant performance improvement for spin lock contention
This patch fixes issues where spinlocks under contention were failing to
wakeup waiters, sometimes resulting in blow ups from 13ns to as high as 256ms.
Under heavy contention, applications were observed sleeping for minutes at a
time giving the appearance of a hang.  


git-svn-id: http://gperftools.googlecode.com/svn/trunk@195 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-10 20:02:46 +00:00
chappedm@gmail.com
b591d53af9 issue-490: Added support for acquire/release atomic exchange
The atomic ops API was missing support for all of the various
flavors of Acquire_AtomicExchange and Release_AtomicExchange
which have now been added.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@194 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-10 19:54:39 +00:00
chappedm@gmail.com
687207b5fc issue-443: Increase the number of objects transferred between thread cache and central free list
This fix is a result of a performance degradation observed in multi-threaded programs where large
amounts of memory (30GB) are consumed, released by a pool of threads in a cyclic manner. This was
mainly due to the amount of time we were spending in the slow path consolidating memory between
the thread cache and central free list. The default has been bumped up to 32768 and is now also
controllable through the TCMALLOC_TRANSFER_NUM_OBJ environment setting.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@193 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-10 19:44:43 +00:00
alkondratenko@gmail.com
19eff86f85 actually made svn:ignore work
git-svn-id: http://gperftools.googlecode.com/svn/trunk@192 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-09 01:16:17 +00:00
alkondratenko@gmail.com
177a896a82 added proper svn:ignore
git-svn-id: http://gperftools.googlecode.com/svn/trunk@191 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-09 01:06:58 +00:00
chappedm@gmail.com
b96203b591 issue-461: Fix to malloc_extension.h so that it builds with -std=gnu++98
git-svn-id: http://gperftools.googlecode.com/svn/trunk@190 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-12-22 20:14:08 +00:00
chappedm@gmail.com
84b983c8d4 issue-465: Adding automagic support for __builtin_expect
Previously __builtin_ expect was based on a macro check against gcc version.
Now we perform the check via AM which is a cleaner approach. There are also
a number of code changes here to utilize LIKELY/UNLIKELY macros based on
__builtin_expect to improve performance.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@189 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-12-22 20:06:47 +00:00