summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Adds system-alloc_unittest Visual Studio projectbaserock/morphPetr Hosek2013-09-212-0/+179
|
* issue-567: Allows for overriding system allocator on WindowsPetr Hosek2013-09-215-63/+196
| | | | | [alk@tut.by: minor changes to make mingw build work] Signed-off-by: Aliaksey Kandratsenka <alk@tut.by>
* Exports SysAllocator class to avoid .dll build errorsPetr Hosek2013-09-211-1/+1
|
* issue-557: added support for dumping heap profile via signalAliaksey Kandratsenka2013-09-141-0/+22
| | | | | | | | | This applies patch from Jean Lee. I've reformatted it to match surronding code style and changed validation logic a bit. I.e. we're not checking signal for range anymore given we're not sure what different platforms support, but we're checking return value of signal() for SIG_ERR instead.
* issue-536: do not PrintStats if running under valgrindAliaksey Kandratsenka2013-09-141-1/+5
| | | | | | | | | | When we detect running under valgrind we do not initialize our own malloc. So trying to print malloc stats when asked via MALLOCSTATS cannot work. This does fix proposed by Philippe Waroquiers. In which we detect running under valgrind prior to checking MALLOCSTATS environment variable and refuse printing stats if we detect valgrind.
* issue-564: added atomic ops support for mips{,64}Aliaksey Kandratsenka2013-09-096-0/+418
| | | | | | | This merges patch contributed by Jovan Zelincevic. And with that patch tcmalloc build with --enable-minimal (just malloc replacement) appears to work (passes unit tests).
* implement pc from ucontext access for mipsAliaksey Kandratsenka2013-08-301-0/+1
|
* issue-413: disable __thread usage on OSXAliaksey Kandratsenka2013-08-291-2/+3
| | | | | | | | Because it was found that __thread variables access is compiled into calls to tlv_get_addr which was found to call malloc. Because we actually use thread-local storage from inside malloc it leads to stack overflow. So we'll continue using pthreads API for that which is known to work on OSX.
* lowered autoconf requirementAliaksey Kandratsenka2013-08-291-1/+1
| | | | | Autoconf 2.59 works. And most notably it will not affect our releases which are all prepared with newer autoconf.
* Update document for tcmallocJoon-Sung Um2013-08-291-11/+11
| | | | | | | | | | Update tcmalloc.html for new parameters. * kMaxSize = 256k * kNumClasses = 88 * kPageShift = 13 Signed-off-by: Aliaksey Kandratsenka <alk@tut.by>
* issue-560: Revert "issue-481: ...Aliaksey Kandratsenka2013-08-171-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | ...Replaced test mechanism for distinct address spaces with a more reliable mechanism" This reverts commit 5dd53ab6cbf9d98f2d60546835e84785a104da46 (svn revision 167) With this commit rhel 6.2 fails heap-checker-death_unittest and without it passes. Ticket refers to 2 things and both are invalid: * that ptrace PEEKDATA ignores data argument. I've checked kernel source and found it to be wrong * something about distinct address spaces And in addition to all that original ticket admits that it doesn't fix anything. It looks like, compared to original code that "fix" is not succesfully wait-ing on parent's ptrace request. I.e. by adding some additional diagnostics I'm seeing this sys_waitpid returning ECHILD.
* issue-561: don't cast function pointer to void *Aliaksey Kandratsenka2013-08-171-3/+3
| | | | | | | | | | Which gcc-3.4 (as shipped in rhel 4) doesn't like. Cast to void * was originally added to avoid issue on OSX which doesn't have sighandler_t. In that place we only need to know if it's null or not. So casting to intptr_t looks like simplest possible way to achieve that.
* add heap-profile-stats.h to dist .tar.gzAliaksey Kandratsenka2013-08-171-1/+2
|
* issue-502: Count m(un)map for each stacktrace in MemoryRegionMapAliaksey Kandratsenka2013-08-047-226/+440
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ..instead of HeapProfileTable This upstreams chromium commit reviewed at: https://codereview.chromium.org/12388070 Original and upstreaming author is: Dai MIKURUBE This patch fixes a bug that gperftools(TCMalloc)'s mmap profiler (HEAP_PROFILE_MMAP) doesn't hook some memory pages used by the profiler itself. This problem has been lived in gperftools for a long time. It is discussed in gperftools' issue 502. https://code.google.com/p/gperftools/issues/detail?id=502 Some bugs in the mmap profiler were fixed by https://code.google.com/p/gperftools/issues/detail?id=383, but the patch in the issue 383 didn't fix the bug mentioned in the issue 502. This change reverts the previous patch and http://crrev.com/132771 at first. Then, it modifies MemoryRegionMap to count m(un)map calls for each stacktrace in itself instead of merging the counts for each stacktrace in HeapProfileTable. This change also cleans up heap-profiler, heap-profile-table and deep-heap-profile. Chromium-BUG=https://code.google.com/p/chromium/issues/detail?id=181517 Chromium-Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=188176
* added .gitignoreAliaksey Kandratsenka2013-08-041-0/+123
|
* Fix a C++11 error.alkondratenko@gmail.com2013-07-311-1/+1
| | | | | | | | | | | | | | | | 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
* bump version to 2.1alkondratenko@gmail.com2013-07-305-9/+22
| | | | git-svn-id: http://gperftools.googlecode.com/svn/trunk@236 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-559: don't setup fork handler in InitStaticVarsalkondratenko@gmail.com2013-07-301-1/+3
| | | | | | | | | | | 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
* issue-559: don't depend on sighandler_talkondratenko@gmail.com2013-07-301-19/+8
| | | | | | | | | | 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
* issue-559: AtomicWord xxx_AtomicExchange are all inlinealkondratenko@gmail.com2013-07-301-4/+4
| | | | | | | | Otherwise OSX correctly complains about duplicate definitions git-svn-id: http://gperftools.googlecode.com/svn/trunk@233 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-556: update windows PACKAGE_{VERSION,STRING}alkondratenko@gmail.com2013-07-261-2/+2
| | | | git-svn-id: http://gperftools.googlecode.com/svn/trunk@232 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-556: dll-export getpagesizealkondratenko@gmail.com2013-07-262-1/+2
| | | | | | | | Because page_heap_test needs this. git-svn-id: http://gperftools.googlecode.com/svn/trunk@231 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-556: drop malloc limit at the end of page_heap_testalkondratenko@gmail.com2013-07-261-0/+7
| | | | | | | | | 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
* issue-556: dll-export TCMalloc_System{Alloc,Release}alkondratenko@gmail.com2013-07-262-5/+9
| | | | | | | | because page_heap_test is using this stuff git-svn-id: http://gperftools.googlecode.com/svn/trunk@229 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-552: Fix page_heap_test for system with different page sizealkondratenko@gmail.com2013-07-261-1/+4
| | | | | | | | | | | | | | | | | | | | 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
* issue-553: Fix syscall wrapper for PowerPCalkondratenko@gmail.com2013-07-266-172/+234
| | | | | | | | | | | | | | | | | | | | | | 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
* updated NEWS and packages/ for 2.1rcalkondratenko@gmail.com2013-07-205-5/+50
| | | | git-svn-id: http://gperftools.googlecode.com/svn/trunk@226 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* bump version number for 2.1rcalkondratenko@gmail.com2013-07-202-5/+5
| | | | git-svn-id: http://gperftools.googlecode.com/svn/trunk@225 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-546: fixed return type of Release_AtomicExchange on arm6+alkondratenko@gmail.com2013-07-201-1/+1
| | | | git-svn-id: http://gperftools.googlecode.com/svn/trunk@224 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-549: handle most recent mingw that has sleep and nanosleepalkondratenko@gmail.com2013-07-202-0/+23
| | | | | | | | | 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
* issue-550: remove config.h.inalkondratenko@gmail.com2013-07-141-280/+0
| | | | | | | | 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
* issue-534: fixed a number of gcc warningsalkondratenko@gmail.com2013-07-065-6/+12
| | | | | | | | This applies patch from Adhemerval Zanella. git-svn-id: http://gperftools.googlecode.com/svn/trunk@221 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-545: corrected README for CPUPROFILE_FREQUENCY variablealkondratenko@gmail.com2013-07-061-1/+1
| | | | | | | | Applied patch by Mikhail Veltishchev git-svn-id: http://gperftools.googlecode.com/svn/trunk@220 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-528: fixed spellingalkondratenko@gmail.com2013-07-0610-10/+10
| | | | | | | | This simply applies patch by Lajos Veres git-svn-id: http://gperftools.googlecode.com/svn/trunk@219 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-518: add support for x32 ABI to linux_syscall_support.halkondratenko@gmail.com2013-05-121-56/+141
| | | | | | | | | 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
* issue-368: allocate enough bytes for large metadata allocationsalkondratenko@gmail.com2013-05-071-1/+1
| | | | | | | | | | 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
* issue-368: added missing large_heap_fragmentation_unittest.ccalkondratenko@gmail.com2013-05-071-0/+62
| | | | git-svn-id: http://gperftools.googlecode.com/svn/trunk@216 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-511: fixed negative offset handling for conditional jumpsalkondratenko@gmail.com2013-05-071-1/+3
| | | | | | | | | | | 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
* issue-511: recognise rex.w jmpq *<literal>(%rip) as iat jumpalkondratenko@gmail.com2013-05-071-0/+13
| | | | | | | | | | | | | 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
* issue-511: implemented rel8 jump patchingalkondratenko@gmail.com2013-05-073-0/+49
| | | | | | | | | | | | 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
* issue-368: test that we don't fragment large spans too badlyalkondratenko@gmail.com2013-05-061-0/+12
| | | | | | | | | | | 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
* issue-{368,443}: allocate metadata in big batchesalkondratenko@gmail.com2013-05-061-4/+49
| | | | | | | | | | | | | | | | | | | | | 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
* issue-368: unmap free spans and retry before growing heapalkondratenko@gmail.com2013-05-061-0/+34
| | | | | | | | | | | | | | | 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
* issue-510: remove duplicate arm #elifalkondratenko@gmail.com2013-04-011-2/+0
| | | | git-svn-id: http://gperftools.googlecode.com/svn/trunk@209 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-506: fixed bogus unit test failurealkondratenko@gmail.com2013-03-111-2/+13
| | | | | | | | | | | 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
* issue-504: disable tls on mingwalkondratenko@gmail.com2013-03-111-1/+9
| | | | | | | | Which is known to fail. git-svn-id: http://gperftools.googlecode.com/svn/trunk@207 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-504: do not define HAVE_MMAP on mingwalkondratenko@gmail.com2013-03-111-0/+5
| | | | | | | | Because, clearly, windows doesn't have one git-svn-id: http://gperftools.googlecode.com/svn/trunk@206 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* issue-504: add AM_LDFLAGS to all *_la targetsalkondratenko@gmail.com2013-03-111-3/+3
| | | | | | | | | | | 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
* issue-504: don't try to typedef pid_t on mingwalkondratenko@gmail.com2013-03-112-0/+5
| | | | | | | | | 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
* issue-504: use gcc inline assembly atomic ops on mingwalkondratenko@gmail.com2013-03-112-2/+3
| | | | | | | | Because those are well tested and can be trusted git-svn-id: http://gperftools.googlecode.com/svn/trunk@203 6b5cf1ce-ec42-a296-1ba9-69fdba395a50