gecko/tools/trace-malloc/lib
Rafael Ávila de Espíndola c171f20afb Bug 696376 - Change how we find critical ranges so that it works on 10.6 too. r=dbaron.
Currently we use dlsym on pthread_cond_wait$UNIX2003 to find a
function that indicates that new_sem_from_pool is on the stack. This
works on 10.5, but on 10.6 I could not find a single reliable
indicator that would work with dlsym.

The good news is that dladdr works with any symbol, not just exported
ones. To find the address of new_sem_from_pool, we set up a malloc logger
and force a call to new_sem_from_pool. From the logger callback we walk
the stack trying dladdr on every address.

To force a call to new_sem_from_pool, the initialization code has to be the
first to use semaphores, so it is now run from NS_LogInit.

This works on 10.6 and 10.5 (but we have to look for
"pthread_cond_wait$UNIX2003"). In 10.7 the call to malloc is gone, so we don't
have to worry about critical addresses on it anymore.

--HG--
extra : rebase_source : bba4ac9e3378c88f7037aa884511e473a57121f6
2011-12-02 19:26:04 -05:00
..
Makefile.in Bug 659621 - Remove EXTRA_DSO_LIBS, EXTRA_DSO_LDOPTS, OS_LIBS from makefiles containing LIBXUL_LIBRARY = 1, now that libxul is always built; r=ted 2011-06-12 03:49:00 -04:00
nsDebugHelpWin32.cpp Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron 2011-10-17 10:59:28 -04:00
nsDebugHelpWin32.h Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones 2011-09-28 23:19:26 -07:00
nsTraceMalloc.c Bug 696376 - Change how we find critical ranges so that it works on 10.6 too. r=dbaron. 2011-12-02 19:26:04 -05:00
nsTraceMalloc.h Bug 529134: Initialize tracemalloc in NS_LogInit() to ensure that tracemalloc is always thread safe. r=bsmedberg r=dbaron 2009-12-29 16:45:59 -06:00
nsTraceMallocCallbacks.h
nsTypeInfo.cpp Bug 658995 part 2 - Use static destructors instead of atexit(). r=bsmedberg 2011-06-15 07:32:03 +02:00
nsWinTraceMalloc.cpp Rollup of bug 645263 and bug 646259: Switch to mozilla:: sync primitives. r=cjones,dbaron,doublec,ehsan src=bsmedberg 2011-03-31 23:29:02 -05:00
tm.def