コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestRuntime"/>.
 /// </summary>
 public TestRuntime()
 {
     _memoryPageManager = new Win32MemoryPageManager();
     _typeLoader = new DefaultTypeSystem();
     _assemblyLoader = new AssemblyLoader(_typeLoader);
     _jitService = new SimpleJitService();
 }
コード例 #2
0
ファイル: CompilationRuntime.cs プロジェクト: hj1980/Mosa
 /// <summary>
 /// Initializes a new instance of <see cref="CompilationRuntime"/>.
 /// </summary>
 public CompilationRuntime()
 {
     _typeLoader = new DefaultTypeSystem();
     _assemblyLoader = new AssemblyLoader(_typeLoader);
     _memoryManager = new MockMemoryPageManager();
     _jitService = new MockJitService();
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestRuntime"/>.
 /// </summary>
 public TestRuntime()
 {
     _memoryPageManager = new Win32MemoryPageManager();
     _typeLoader        = new DefaultTypeSystem();
     _assemblyLoader    = new AssemblyLoader(_typeLoader);
     _jitService        = new SimpleJitService();
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of <see cref="CompilationRuntime"/>.
 /// </summary>
 public CompilationRuntime()
 {
     this.typeLoader = new DefaultTypeSystem();
     this.assemblyLoader = new AssemblyLoader(this.typeLoader);
     this.memoryManager = new MockMemoryPageManager();
     this.jitService = new MockJitService();
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of <see cref="CompilationRuntime"/>.
 /// </summary>
 public CompilationRuntime()
 {
     _typeLoader     = new DefaultTypeSystem();
     _assemblyLoader = new AssemblyLoader(_typeLoader);
     _memoryManager  = new MockMemoryPageManager();
     _jitService     = new MockJitService();
 }
コード例 #6
0
        /// <summary>
        /// Initializes a new <see cref="VirtualMemoryStream"/> and allocates the requested amount of virtual memory to back it.
        /// </summary>
        /// <param name="pageManager"></param>
        /// <param name="allocationSize">The number of bytes to allocate from virtual memory.</param>
        public unsafe VirtualMemoryStream(IMemoryPageManager pageManager, uint allocationSize)
        {
            _memory = pageManager.Allocate(IntPtr.Zero, allocationSize, PageProtectionFlags.Read | PageProtectionFlags.Write | PageProtectionFlags.Execute);
            if (IntPtr.Zero == _memory)
                throw new OutOfMemoryException();

            base.Initialize((byte*)_memory.ToPointer(), allocationSize, allocationSize, FileAccess.Write);
            _allocationSize = allocationSize;
            _pageManager = pageManager;
        }
コード例 #7
0
        /// <summary>
        /// Initializes a new <see cref="VirtualMemoryStream"/> and allocates the requested amount of virtual memory to back it.
        /// </summary>
        /// <param name="pageManager"></param>
        /// <param name="allocationSize">The number of bytes to allocate from virtual memory.</param>
        public unsafe VirtualMemoryStream(IMemoryPageManager pageManager, uint allocationSize)
        {
            _memory = pageManager.Allocate(IntPtr.Zero, allocationSize, PageProtectionFlags.Read | PageProtectionFlags.Write | PageProtectionFlags.Execute);
            if (IntPtr.Zero == _memory)
            {
                throw new OutOfMemoryException();
            }

            base.Initialize((byte *)_memory.ToPointer(), allocationSize, allocationSize, FileAccess.Write);
            _allocationSize = allocationSize;
            _pageManager    = pageManager;
        }