Ejemplo n.º 1
0
        static JitCache()
        {
            _basePointer = MemoryManagement.Allocate(CacheSize);

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                JitUnwindWindows.InstallFunctionTableHandler(_basePointer, CacheSize);

                // The first page is used for the table based SEH structs.
                _offset = PageSize;
            }

            _cacheEntries = new List <JitCacheEntry>();

            _lock = new object();
        }
Ejemplo n.º 2
0
        static JitCache()
        {
            _jitRegion = new ReservedRegion(CacheSize);

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                _jitRegion.ExpandIfNeeded(PageSize);
                JitUnwindWindows.InstallFunctionTableHandler(_basePointer, CacheSize);

                // The first page is used for the table based SEH structs.
                _offset = PageSize;
            }

            _cacheEntries = new List <JitCacheEntry>();

            _lock = new object();
        }
Ejemplo n.º 3
0
        public static void Initialize(IJitMemoryAllocator allocator)
        {
            if (_initialized) return;
            lock (_lock)
            {
                if (_initialized) return;
                _jitRegion = new ReservedRegion(allocator, CacheSize);

                if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
                {
                    _jitRegion.ExpandIfNeeded(PageSize);
                    JitUnwindWindows.InstallFunctionTableHandler(_jitRegion.Pointer, CacheSize);

                    // The first page is used for the table based SEH structs.
                    _offset = PageSize;
                }
                _initialized = true;
            }
        }