Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Unity-Technologies/bdwgc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-07Merge pull request #68 from Unity-Technologies/unity-master-fix-win-incrementalHEADunity-masterJonathan Chambers
Fix incremental GC thread stack/register pushing on windows (case 1411601)
2022-04-05Adjust Wow64 workaround to work on UWP/WinRT.unity-master-fix-win-incrementalJonathan Chambers
* Dynamically lookup IsWow64Process2 and fallback to IsWow64Process if needed. * Store TIB on each thread and lookup via call to NtCurrentTeb on thread registration rather than calling GetThreadSelectorEntry which is not available on UWP.
2022-03-17Fix issue due to missing upstream commit.Jonathan Chambers
We are missing commit 5668de71107022a316ee967162bc16c10754b9ce in our branch, and previous commit references variables added in this commit.
2022-03-16Prevent use of unsaved thread context registers in incremental GC (Windows)Ivan Maidanski
(fix of commits 449eda034, 190e18c75) During incremental collection GC_push_all_stacks() may be called when the world is not stopped. If the context registers and sp value are saved during thread suspension then GC_push_all_stacks() gets these values of the previous GC cycle or, even, gets all zeros instead the context registers and sp on the first GC after the thread creation. This commit fixes this by calling GetThreadContext in GC_push_stack_for if thread is not suspended. * win32_threads.c (first_thread): Refine the comment. * win32_threads.c [!GC_NO_THREADS_DISCOVERY && RETRY_GET_THREAD_CONTEXT] (GC_delete_gc_thread_no_free): Reset context_sp if GC_win32_dll_threads. * win32_threads.c (GC_push_stack_for): Change the assertion expression from thread->suspended to thread->suspended||!GC_world_stopped (the assertion is off unless THREAD_LOCAL_ALLOC). * win32_threads.c [RETRY_GET_THREAD_CONTEXT] (GC_push_stack_for): If thread is not suspended then call GetThreadContext(), if it fails then use sp value and the context registers saved during the latest stop-the-world; add comments. * win32_threads.c (GC_push_all_stacks): Add the title comment (copied from pthread_stop_world.c).
2022-03-16Add assertion that thread is suspended when using context registersIvan Maidanski
* win32_threads.c (GC_push_stack_for): Add assertion that thread is suspended (before using context registers) if thread is not self and not blocked.
2022-03-16Fix incorrect code generation by MS VC caused by excessive Thread_Rep sizeIvan Maidanski
(fix of commit 449eda034) The gctest crashes were observed in debug builds produced by MS VC. In addition, this change greatly reduces memory usage by GC_threads[] and dll_thread_table[] (compared to the solution that stores the full CONTEXT in GC_Thread_Rep). * win32_threads.c (copy_ptr_regs): Declare static function. * win32_threads.c (PUSHED_REGS_COUNT): Define macro. * win32_threads.c [RETRY_GET_THREAD_CONTEXT] (GC_Thread_Rep.saved_context): Move down to be the last field; change type from CONTEXT to word[PUSHED_REGS_COUNT]; rename to context_regs. * win32_threads.c [RETRY_GET_THREAD_CONTEXT] (GC_Thread_Rep.context_sp): New field. * win32_threads.c [RETRY_GET_THREAD_CONTEXT] (GC_suspend): Declare context local variable and use it for GetThreadContext() call; if the latter succeeds then call copy_ptr_regs(); update comment. * win32_threads.c (copy_ptr_regs): Define static function (move PUSH-related part of GC_push_stack_for code here); change PUSH1(reg) to store reg to regs[]; define context as *pcontext; add assertion that number of stored registers is equal to PUSHED_REGS_COUNT. * win32_threads.c [WOW64_THREAD_CONTEXT_WORKAROUND] (copy_ptr_regs): Store ContextFlags and SegFs as the first elements of regs[]. * win32_threads.c (GC_push_stack_for): Declare i local variable (set to 0). * win32_threads.c [RETRY_GET_THREAD_CONTEXT] (GC_push_stack_for): Replace pcontext and context with word *regs; set sp from thread->context_sp; remove undef context. * win32_threads.c [!RETRY_GET_THREAD_CONTEXT] (GC_push_stack_for): Declare regs[PUSHED_REGS_COUNT]; call copy_ptr_regs() to initialize regs[] and sp; limit context scope to GetThreadContext() and copy_ptr_regs() calls only. * win32_threads.c (GC_push_stack_for): Call GC_push_one() for each regs[] element (except for the first 2 ones if WOW64_THREAD_CONTEXT_WORKAROUND). * win32_threads.c [WOW64_THREAD_CONTEXT_WORKAROUND] (GC_push_stack_for): Define ContextFlags, SegFs local variables (the values are obtained from regs[]); use these variables instead of context one; do not overwrite sp local variable value so that not to use context.Esp directly (i.e. not to use context out of its scope).
2022-03-16Prevent GetThreadContext failure (Windows)Jonathan Chambers
(a cherry-pick of commits 3f39ea8, ab3699da from 'unity-master') Calls to GetThreadContext may fail. Work around this by putting access in suspend/resume loop to advance thread past problematic areas where suspend fails. Capture context in per thread structure at suspend time rather than retreiving it during the push logic. * include/private/gcconfig.h [(I386 || X86_64) && (CYGWIN32 || MSWIN32)] (RETRY_GET_THREAD_CONTEXT): Define macro. * win32_threads.c [RETRY_GET_THREAD_CONTEXT] (MAX_SUSPEND_THREAD_RETRIES): Likewise. * include/private/gcconfig.h [NO_RETRY_GET_THREAD_CONTEXT] (RETRY_GET_THREAD_CONTEXT): Undefine macro (for test purposes). * win32_threads.c [RETRY_GET_THREAD_CONTEXT] (GC_Thread_Rep): Add saved_context field; add comment. * win32_threads.c [RETRY_GET_THREAD_CONTEXT] (GC_suspend): Define retry_cnt local variable; set ContextFlags and call GetThreadContext() after invocation of SuspendThread(); call ResumeThread() and proceed to SuspendThread() if GetThreadContext() failed (the limit of iterations is MAX_SUSPEND_THREAD_RETRIES); call Sleep(0) after ResumeThread() or failed SuspendThread() except for the first 2 iterations. * win32_threads.c [RETRY_GET_THREAD_CONTEXT] (GC_push_stack_for): Declare pcontext local variable (which refers to thread->saved_context); define context as a macro (to *pcontext) instead of a local variable; add comment; do not set ContextFlags and do not call GetThreadContext(); undefine context after last use of PUSHn().
2022-03-16Refactoring of WoW64 workaround (Win32)Ivan Maidanski
(code refactoring of commit 9483d5bba) Issue #262 (bdwgc). * include/private/gcconfig.h [I386 && (CYGWIN32 || MSWIN32)] (WOW64_THREAD_CONTEXT_WORKAROUND): Define macro. * win32_threads.c [!CONTEXT_EXCEPTION_ACTIVE] (CONTEXT_EXCEPTION_ACTIVE, CONTEXT_EXCEPTION_REQUEST, CONTEXT_EXCEPTION_REPORTING): Move macro definition upper to be before GC_suspend(); define only if WOW64_THREAD_CONTEXT_WORKAROUND is defined (instead of I386). * win32_threads.c (isWow64): Move static variable upper to be before GC_suspend(); define only if WOW64_THREAD_CONTEXT_WORKAROUND. * win32_threads.c (GET_THREAD_CONTEXT_FLAGS): New macro. * win32_threads.c (GC_push_stack_for): Always set context.ContextFlags to GET_THREAD_CONTEXT_FLAGS. * win32_threads.c [I386] (GC_push_stack_for): Always store context.Esp to sp (as the initial value). * win32_threads.c (GC_push_stack_for): Use WoW64 workaround only if WOW64_THREAD_CONTEXT_WORKAROUND (instead of I386). * win32_threads.c (GC_thr_init): Set isWow64 only if WOW64_THREAD_CONTEXT_WORKAROUND (instead of I386).
2022-03-16Fix GetThreadContext stale register values use if WoW64 (Win32)Hamayama
Issue #262 (bdwgc). * misc.c [MSWIN32 && !MSWINRT_FLAVOR && !MSWIN_XBOX1] (GC_win32_MessageBoxA): Do not define unless SMALL_CONFIG. * misc.c [MSWIN32 && !_WIN64 && GC_WIN32_THREADS && CHECK_NOT_WOW64] (GC_init): Do not call IsWow64Process() and GC_win32_MessageBoxA(). * win32_threads.c [I386] (isWow64): New static variable. * win32_threads.c [I386] (GC_push_stack_for): If isWow64 then set also CONTEXT_EXCEPTION_REQUEST and CONTEXT_SEGMENTS bits in ContextFlags; if isWow64, and CONTEXT_EXCEPTION_REPORTING and CONTEXT_EXCEPTION_ACTIVE are set on return from GetThreadContext then call GetThreadSelectorEntry and use StackLimit of FS selector to set sp local variable (instead of context.Esp); add comment. * win32_threads.c [I386 && DEBUG_THREADS] (GC_push_stack_for): Call GC_log_printf() to report TIB stack limit/base and the case when CONTEXT_EXCEPTION_REQUEST is not supported. * win32_threads.c [I386] (GC_thr_init): Set isWow64 by IsWow64Process() if the later is available.
2021-12-02Merge pull request #67 from Unity-Technologies/platform/hmi/qnxAlexander Ederer
QNX Platform
2021-12-02QNX change order of arm64/arm32 detectionplatform/hmi/qnxAlexander Ederer
2021-11-23Merge branch 'unity-master' into platform/hmi/qnxAlexander Ederer
2021-11-08Adding a call to allow the finalizer loop to be interrupted.Bill Holmes
GC_invoke_finalizers can take a long period of time to complete. During Mono shutdown we need a way to safely stop the finalization of objects.
2021-10-05Merge pull request #65 from Unity-Technologies/unity-master-ephemeron-callbackJonathan Chambers
Add callback to support ephemeron marking in Mono.
2021-09-28Add callback to support ephemeron marking in Mono.Jonathan Chambers
2021-09-14Merge pull request #64 from akoeplinger/patch-1Jonathan Chambers
Stop using git protocol for libatomic_ops submodule
2021-09-02Stop using git protocol for submoduleAlexander Köplinger
GitHub is removing support for unauthenticated git soon: https://github.blog/2021-09-01-improving-git-protocol-security-github/
2021-07-22Merge branch 'unity-master' into platform/hmi/qnx-evluationMario Hoepfner
2021-07-08fix qnx stack bottom for x64Mario Hoepfner
2021-03-04Provide the top stack address on QNXMario Topf
The other available heuristics did't work out here so I added a new custom approach using GCC's __builtin_frame_address() (https://gcc.gnu.org/onlinedocs/gcc/Return-Address.html). While this approach is not very exact it still works for my test projects I've tried. Another approach would be to get a hold of the stack inside the main function and directly handing that data over to the GC. Since this design would be more involved I'd only tackle it if necessary.
2021-01-22Fine tune #defines to get rid of linker errorsMario Topf
2021-01-21Add support for QNXMario Topf
These adaptions are needed to make the il2cpp branch platform/hmi/qnx-evaluation produce output for all 4 target architectures: Intel x86+x86_64,arm32 and arm64.
2020-08-04Merge pull request #60 from ↵Jonathan Chambers
Unity-Technologies/unity-master-darwin-stop-world-fix Add loop to handle abort error like in suspend logic.
2020-08-04Add loop to handle abort error like in suspend logic.Jonathan Chambers
2020-07-01Merge pull request #59 from Unity-Technologies/signal-retry-speedupScott Ferguson
Fix Performance Regression with GC_retry_signals enabled (Case 1255866)
2020-06-29Fix Performance Regression with GC_retry_signals enabled (Case 1255866)Scott Ferguson
The original GC_retry_signals case would almost always introduce a 3ms pause when stopping and starting the world. Instead only fallback to that retry case if the threads haven't responded after a timeout.
2020-06-12Merge pull request #58 from Unity-Technologies/tiny-emscripten-allocatorJoshua Peterson
Use a specific Emscripten allocator for Tiny
2020-06-11Use a specific Emscripten allocator for Tinytiny-emscripten-allocatorJosh Peterson
This allocator allows the GC to use the same allocator as the rest of Emscripten, to avoid unnecessary heap fragmentation. The Emscripten used in full Unity doesn't have this feature yet, so we'll put this behind a define that is only enabled for Tiny.
2020-05-28Merge pull request #57 from Unity-Technologies/disable-automatic-collection-apijonas echterhoff
Add GC_set_disable_automatic_collection API to disable automatic peri…
2020-05-28Add GC_set_disable_automatic_collection API to disable automatic periodic ↵disable-automatic-collection-apiJonas Echterhoff
collections
2020-05-28Merge pull request #56 from Unity-Technologies/fix-nda-platformsTim Cannell
Fix nda platforms
2020-05-27Merge pull request #55 from ↵Jonathan Chambers
Unity-Technologies/unity-master-precise-array-marking-stack-limit Avoid exceeding the mark stack limit (case 1235202)
2020-05-27Avoid exceeding the mark stack limitJonathan Chambers
2020-05-27remove accidentally added filefix-nda-platformstimcannell
2020-05-26Merge pull request #54 from Unity-Technologies/trigger-gc-apijonas echterhoff
Add GC_trigger_collection API
2020-05-26Change name; also start collectionJonas Echterhoff
2020-05-18Add GC_trigger_collection APIJonas Echterhoff
2020-05-15nda platform changestimcannell
2020-05-15Merge branch 'unity-master' into fix-nda-platformstimcannell
2020-03-23Merge pull request #53 from Unity-Technologies/switch-time-fixjonas echterhoff
Fix GET_TIME, MS_TIME_DIFF & NS_TIME_DIFF macros for Switch.
2020-03-23Fix GET_TIME, MS_TIME_DIFF & NS_TIME_DIFF macros for Switch.James Moran
2020-02-29fix platform issuestimcannell
2020-02-26extract platform defines to seperate values that can be set from the compilertimcannell
2020-02-05Merge pull request #52 from Unity-Technologies/enable-gc-retry-signalsScott Ferguson
Default GC_retry_signals=TRUE always
2020-01-31Default GC_retry_signals=TRUE alwaysenable-gc-retry-signalsScott Ferguson
We saw GC lockups because of lost signals on Android. Any platform could lose signals, so we'll be conserative and always retry.
2019-12-04Merge pull request #51 from Unity-Technologies/fix-arm64-hangJoshua Peterson
Really fix 'potential unsafe sign check of a bitwise operation' code …
2019-12-03Really fix 'potential unsafe sign check of a bitwise operation' code defectIvan Maidanski
(fix of commit af00c4d) * mark.c [!OS2] (GC_mark_from): Replace (signed_word)v>=0 to (v&SIGNB)==0 (anyway, the compiler generates the same code).
2019-12-03Fixes for upstream Mono (#50)Jonathan Chambers
* Ensure *.sh files use LF line endings * Bump libatomic_ops with fix for cygwin * Use noinst_LTLIBRARIES to avoid libtool wrapper scripts in mono source tree.
2019-12-03Merge pull request #49 from Unity-Technologies/fix-reload-winrtJoshua Peterson
Remove code that attempt to free the heap on Windows
2019-12-03Remove code that attempt to free the heap on WindowsJosh Peterson
This causes problems in Unity for the UWP player when it unloads IL2CPP. It looks like it was never actually necessary on Windows desktop either, so let's remove it.