- Timestamp:
- Nov 4, 2023 6:26:43 PM (16 months ago)
- svn:sync-xref-src-repo-rev:
- 159873
- Location:
- trunk/src/libs/xpcom18a4
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h
r101773 r101777 200 200 (thr->interrupt_blocked = 0) 201 201 202 #ifdef GC_LEAK_DETECTOR203 /* All threads are GCable. */204 #define _PT_IS_GCABLE_THREAD(thr) 1205 #else206 202 #define _PT_IS_GCABLE_THREAD(thr) ((thr)->state & PT_THREAD_GCABLE) 207 #endif /* GC_LEAK_DETECTOR */208 203 209 204 /* … … 651 646 #endif 652 647 653 #ifdef GC_LEAK_DETECTOR654 /* All threads are GCable. */655 #define _PR_IS_GCABLE_THREAD(thr) 1656 #else657 648 #define _PR_IS_GCABLE_THREAD(thr) ((thr)->flags & _PR_GCABLE_THREAD) 658 #endif /* GC_LEAK_DETECTOR */659 649 660 650 #define _PR_PENDING_INTERRUPT(thr) \ … … 1802 1792 extern void _PR_LogCleanup(void); 1803 1793 extern void _PR_InitLayerCache(void); 1804 #ifdef GC_LEAK_DETECTOR1805 extern void _PR_InitGarbageCollector(void);1806 #endif1807 1794 1808 1795 extern PRBool _pr_initialized; -
trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prinit.c
r101773 r101777 213 213 PR_ASSERT(NULL != _pr_sleeplock); 214 214 215 #ifdef GC_LEAK_DETECTOR216 _PR_InitGarbageCollector();217 #endif218 219 215 _PR_InitThreads(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0); 220 221 #ifdef WIN16222 {223 PRInt32 top; /* artificial top of stack, win16 */224 _pr_top_of_task_stack = (char *) ⊤225 }226 #endif227 216 228 217 #ifndef _PR_GLOBAL_THREADS_ONLY -
trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptthread.c
r101773 r101777 102 102 #endif 103 103 104 #if defined(GC_LEAK_DETECTOR) && (__GLIBC__ >= 2) && defined(__i386__)105 106 #include <setjmp.h>107 108 typedef struct stack_frame stack_frame;109 110 struct stack_frame {111 stack_frame* next;112 void* pc;113 };114 115 static stack_frame* GetStackFrame()116 {117 jmp_buf jb;118 stack_frame* currentFrame;119 setjmp(jb);120 currentFrame = (stack_frame*)(jb[0].__jmpbuf[JB_BP]);121 currentFrame = currentFrame->next;122 return currentFrame;123 }124 125 static void* GetStackTop()126 {127 stack_frame* frame;128 frame = GetStackFrame();129 while (frame != NULL)130 {131 ptrdiff_t pc = (ptrdiff_t)frame->pc;132 if ((pc < 0x08000000) || (pc > 0x7fffffff) || (frame->next < frame))133 return frame;134 frame = frame->next;135 }136 return NULL;137 }138 #endif /* GC_LEAK_DETECTOR && (__GLIBC__ >= 2) && __i386__ */139 140 104 /* 141 105 ** Initialize a stack for a native pthread thread … … 154 118 ts->stackTop = ts->allocBase; 155 119 #else 156 #ifdef GC_LEAK_DETECTOR157 ts->stackTop = GetStackTop();158 ts->stackBottom = ts->stackTop - ts->stackSize;159 #else160 120 ts->stackTop = ts->allocBase; 161 121 ts->stackBottom = ts->allocBase - ts->stackSize; 162 #endif163 122 #endif 164 123 } -
trunk/src/libs/xpcom18a4/xpcom/base/nsTraceRefcntImpl.cpp
r64625 r101777 584 584 static PRInt32 GetSerialNumber(void* aPtr, PRBool aCreate) 585 585 { 586 #ifdef GC_LEAK_DETECTOR587 // need to disguise this pointer, so the table won't keep the object alive.588 aPtr = (void*) ~PLHashNumber(aPtr);589 #endif590 586 PLHashEntry** hep = PL_HashTableRawLookup(gSerialNumbers, PLHashNumber(NS_PTR_TO_INT32(aPtr)), aPtr); 591 587 if (hep && *hep) { … … 607 603 static PRInt32* GetRefCount(void* aPtr) 608 604 { 609 #ifdef GC_LEAK_DETECTOR610 // need to disguise this pointer, so the table won't keep the object alive.611 aPtr = (void*) ~PLHashNumber(aPtr);612 #endif613 605 PLHashEntry** hep = PL_HashTableRawLookup(gSerialNumbers, PLHashNumber(NS_PTR_TO_INT32(aPtr)), aPtr); 614 606 if (hep && *hep) { … … 621 613 static PRInt32* GetCOMPtrCount(void* aPtr) 622 614 { 623 #ifdef GC_LEAK_DETECTOR624 // need to disguise this pointer, so the table won't keep the object alive.625 aPtr = (void*) ~PLHashNumber(aPtr);626 #endif627 615 PLHashEntry** hep = PL_HashTableRawLookup(gSerialNumbers, PLHashNumber(NS_PTR_TO_INT32(aPtr)), aPtr); 628 616 if (hep && *hep) { … … 635 623 static void RecycleSerialNumberPtr(void* aPtr) 636 624 { 637 #ifdef GC_LEAK_DETECTOR638 // need to disguise this pointer, so the table won't keep the object alive.639 aPtr = (void*) ~PLHashNumber(aPtr);640 #endif641 625 PL_HashTableRemove(gSerialNumbers, aPtr); 642 626 } -
trunk/src/libs/xpcom18a4/xpcom/build/nsXPComInit.cpp
r28992 r101777 110 110 #include "nsVariant.h" 111 111 112 #ifdef GC_LEAK_DETECTOR113 #include "nsLeakDetector.h"114 #endif115 112 #include "nsRecyclingAllocator.h" 116 113 … … 634 631 if (NS_FAILED(rv)) return rv; 635 632 636 #ifdef GC_LEAK_DETECTOR637 rv = NS_InitLeakDetector();638 if (NS_FAILED(rv)) return rv;639 #endif640 641 633 // 2. Register the global services with the component manager so that 642 634 // clients can create new objects. … … 970 962 nsTraceRefcntImpl::ResetStatistics(); 971 963 nsTraceRefcntImpl::Shutdown(); 972 #endif973 974 #ifdef GC_LEAK_DETECTOR975 // Shutdown the Leak detector.976 NS_ShutdownLeakDetector();977 964 #endif 978 965
Note:
See TracChangeset
for help on using the changeset viewer.