diff --git a/mozilla/tools/leaky/config.h b/mozilla/tools/leaky/config.h index 4db44b6d962..d79021dcd62 100644 --- a/mozilla/tools/leaky/config.h +++ b/mozilla/tools/leaky/config.h @@ -16,7 +16,7 @@ #include -#ifdef linux +#if defined(linux) || defined(NTO) #define USE_BFD #undef NEED_WRAPPERS diff --git a/mozilla/tools/leaky/dict.cpp b/mozilla/tools/leaky/dict.cpp index c086a767d32..02f10beb1f7 100644 --- a/mozilla/tools/leaky/dict.cpp +++ b/mozilla/tools/leaky/dict.cpp @@ -13,6 +13,11 @@ #include #include "dict.h" +#ifdef __QNXNTO__ +/* Need definition of NULL */ +#include +#endif + MallocDict::MallocDict(int nb) { numBuckets = nb; diff --git a/mozilla/tools/leaky/leaky.cpp b/mozilla/tools/leaky/leaky.cpp index ff5a3e78424..15bd132c64d 100644 --- a/mozilla/tools/leaky/leaky.cpp +++ b/mozilla/tools/leaky/leaky.cpp @@ -19,11 +19,17 @@ #include #include #include +#ifndef NTO #include +#endif #include #include #include +#ifdef NTO +#include +#endif + #ifndef FALSE #define FALSE 0 #endif diff --git a/mozilla/tools/leaky/libmalloc.cpp b/mozilla/tools/leaky/libmalloc.cpp index a74bb73f831..b03f869754f 100644 --- a/mozilla/tools/leaky/libmalloc.cpp +++ b/mozilla/tools/leaky/libmalloc.cpp @@ -19,7 +19,18 @@ #include #include #include + +#ifdef NTO +#include +extern r_debug _r_debug; +#else #include +#endif + +#ifdef NTO +#define JB_BP 0x08 +#include +#endif extern "C" { #ifdef NEED_WRAPPERS @@ -65,7 +76,11 @@ struct Trailer { #if defined(i386) static void CrawlStack(malloc_log_entry* me, jmp_buf jb) { +#ifdef NTO + u_long* bp = (u_long*) (jb[0].__savearea[JB_BP]); +#else u_long* bp = (u_long*) (jb[0].__jmpbuf[JB_BP]); +#endif u_long numpcs = 0; int skip = 2; while (numpcs < MAX_STACK_CRAWL) { @@ -85,7 +100,7 @@ static void CrawlStack(malloc_log_entry* me, jmp_buf jb) //---------------------------------------------------------------------- -#ifdef linux +#if defined(linux) || defined(NTO) static void DumpAddressMap() { int mfd = open("malloc-map", O_CREAT|O_WRONLY|O_TRUNC, 0666); @@ -308,9 +323,11 @@ SetMallocFlags(u_long aFlags) close(gLogFD); gLogFD = -1; } +#ifndef NTO if (LIBMALLOC_CHECK & gFlags) { mallopt(M_CHECK_ACTION, 1); } +#endif // Try to guarantee that the address map is always dumped atexit(DumpAddressMap);