Changeset 101777 in vbox for trunk/src/libs/xpcom18a4/nsprpub
- Timestamp:
- Nov 4, 2023 6:26:43 PM (15 months ago)
- Location:
- trunk/src/libs/xpcom18a4/nsprpub/pr
- Files:
-
- 3 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 }
Note:
See TracChangeset
for help on using the changeset viewer.