GC OS interface refactoring
authorJan Vorlicek <janvorli@microsoft.com>
Wed, 14 Oct 2015 01:01:25 +0000 (03:01 +0200)
committerJan Vorlicek <janvorli@microsoft.com>
Thu, 24 Dec 2015 09:09:30 +0000 (10:09 +0100)
commit54990d90fcffbae79d72cfb2e37bb4cac4e0660c
tree299c88fa672bbdb2b4ce609df52945cf7d29326d
parent38e554e5dcb8f6de9c014c5e1839b564a64937f6
GC OS interface refactoring

This change replaces all calls of OS specific functions in the GC by a call to
a platform agnostic interface. Critical sections were abstracted too.
The logging file access was changed to use CRT functions instead of Windows specific APIs.
A "size" member was added to the card_table_info so that we can pass the right
size to the VirtualRelease method when destroying the card table.
I have also fixed a bug in the gc_heap::make_card_table error path where when VirtualCommit
failed, it called VirtualRelease with size that was not the reserved size, but
the committed size.
Other related changes
- All interlocked operations moved to Interlocked class as static methods
- Removed unused function prototypes
- Shuffled stuff in the root CMakeLists.txt to enable building the GC sample using the
  settings inherited from the root CMakeLists.txt and to clean up some things that have
  rotted over time, like the FEATURE_xxx macros not being in one alphabetically ordered
  block
- Fixed the VOLATILE_MEMORY_BARRIER macro in the gcenv.base.h
- Replaced uint32_t thread id by EEThreadId
- Removed thread handles storage (g_gc_thread) from the GC. The thread handle is closed right after the thread is launched. That allowed me to get rid of the GCThreadHandle
- Renamed the methods of the EEThreadId to be easier to understand
- Moved the gcenv.windows.cpp and gcenv.unix.cpp to the sample folder
60 files changed:
CMakeLists.txt
src/corefx/System.Globalization.Native/CMakeLists.txt
src/debug/ee/rcthread.cpp
src/dlls/mscoree/coreclr/CMakeLists.txt
src/gc/env/common.h
src/gc/env/gcenv.base.h
src/gc/env/gcenv.ee.h [new file with mode: 0644]
src/gc/env/gcenv.interlocked.h [new file with mode: 0644]
src/gc/env/gcenv.interlocked.inl [new file with mode: 0644]
src/gc/env/gcenv.object.h
src/gc/env/gcenv.os.h [new file with mode: 0644]
src/gc/env/gcenv.structs.h
src/gc/env/gcenv.sync.h
src/gc/env/gcenv.windows.cpp [deleted file]
src/gc/gc.cpp
src/gc/gcee.cpp
src/gc/gcpriv.h
src/gc/gcscan.cpp
src/gc/handletable.cpp
src/gc/handletable.inl
src/gc/handletablecache.cpp
src/gc/handletablecore.cpp
src/gc/objecthandle.cpp
src/gc/sample/CMakeLists.txt
src/gc/sample/GCSample.cpp
src/gc/sample/GCSample.vcxproj
src/gc/sample/GCSample.vcxproj.filters
src/gc/sample/gcenv.cpp [deleted file]
src/gc/sample/gcenv.ee.cpp [new file with mode: 0644]
src/gc/sample/gcenv.h
src/gc/sample/gcenv.unix.cpp [moved from src/gc/env/gcenv.unix.cpp with 91% similarity]
src/gc/sample/gcenv.windows.cpp [new file with mode: 0644]
src/pal/inc/pal.h
src/pal/src/exception/seh.cpp
src/pal/src/misc/time.cpp
src/pal/src/thread/context.cpp
src/pal/tests/palsuite/eventprovider/CMakeLists.txt
src/strongname/api/api.props
src/strongname/api/common.h
src/vm/CMakeLists.txt
src/vm/appdomain.cpp
src/vm/common.h
src/vm/crst.cpp
src/vm/crst.h
src/vm/eehash.inl
src/vm/gcenv.ee.cpp [moved from src/vm/gcenv.cpp with 97% similarity]
src/vm/gcenv.ee.h [new file with mode: 0644]
src/vm/gcenv.h
src/vm/gcenv.interlocked.h [new file with mode: 0644]
src/vm/gcenv.interlocked.inl [new file with mode: 0644]
src/vm/gcenv.os.cpp [new file with mode: 0644]
src/vm/gcenv.os.h [new file with mode: 0644]
src/vm/hash.cpp
src/vm/spinlock.cpp
src/vm/syncblk.cpp
src/vm/syncblk.h
src/vm/threads.cpp
src/vm/threadsuspend.cpp
src/vm/util.hpp
src/vm/wks/wks.targets