コード例 #1
0
ファイル: TestHeap.cs プロジェクト: WalterBarrett/win3mu
        public TestHeap(int size)
        {
            _allocator = new RangeAllocator <TestAllocation>(size);
            _allocator.MoveListener = this;

            _buffer = new byte[size];
        }
コード例 #2
0
ファイル: TestHeap.cs プロジェクト: WalterBarrett/win3mu
        object RangeAllocator <TestAllocation> .IMoveListener.Save(RangeAllocator <TestAllocation> .Range entry)
        {
            var save = new byte[entry.Size];

            Buffer.BlockCopy(_buffer, entry.Position, save, 0, entry.Size);
            return(save);
        }
コード例 #3
0
        public void Compile(IFileSystem fileSystem)
        {
            var allocator     = new RangeAllocator(RomConfig.FreeRanges);
            var outputRomData = new Block(RomData);
            var compiler      = Compiler.Create(outputRomData, allocator, Modules);

            compiler.Compile();

            var binaryManager = new BinaryFileManager(fileSystem);

            binaryManager.WriteFile(ProjectSettings.OutputRomPath, outputRomData);
        }
コード例 #4
0
ファイル: TestHeap.cs プロジェクト: WalterBarrett/win3mu
 void RangeAllocator <TestAllocation> .IMoveListener.Move(RangeAllocator <TestAllocation> .Range entry, int newPosition)
 {
     Debug.Assert(entry.Position == entry.User.position);
     Buffer.BlockCopy(_buffer, entry.Position, _buffer, newPosition, entry.Size);
     entry.User.position = newPosition;
 }
コード例 #5
0
ファイル: TestHeap.cs プロジェクト: WalterBarrett/win3mu
 void RangeAllocator <TestAllocation> .IMoveListener.Load(RangeAllocator <TestAllocation> .Range entry, object data)
 {
     Buffer.BlockCopy((byte[])data, 0, _buffer, entry.Position, entry.Size);
 }