misc: chore: Use explicit types in ARMeilleure project

This commit is contained in:
Evan Husted 2025-01-25 14:01:13 -06:00
parent be3bd0bcb5
commit e0567c5ce9
37 changed files with 109 additions and 106 deletions

View file

@ -1,5 +1,6 @@
using ARMeilleure.CodeGen.Linking;
using ARMeilleure.IntermediateRepresentation;
using Microsoft.IO;
using Ryujinx.Common.Memory;
using System;
using System.Collections.Generic;
@ -1324,8 +1325,8 @@ namespace ARMeilleure.CodeGen.X86
public (byte[], RelocInfo) GetCode()
{
var jumps = CollectionsMarshal.AsSpan(_jumps);
var relocs = CollectionsMarshal.AsSpan(_relocs);
Span<Jump> jumps = CollectionsMarshal.AsSpan(_jumps);
Span<Reloc> relocs = CollectionsMarshal.AsSpan(_relocs);
// Write jump relative offsets.
bool modified;
@ -1410,13 +1411,13 @@ namespace ARMeilleure.CodeGen.X86
// Write the code, ignoring the dummy bytes after jumps, into a new stream.
_stream.Seek(0, SeekOrigin.Begin);
using var codeStream = MemoryStreamManager.Shared.GetStream();
var assembler = new Assembler(codeStream, HasRelocs);
using RecyclableMemoryStream codeStream = MemoryStreamManager.Shared.GetStream();
Assembler assembler = new Assembler(codeStream, HasRelocs);
bool hasRelocs = HasRelocs;
int relocIndex = 0;
int relocOffset = 0;
var relocEntries = hasRelocs
RelocEntry[] relocEntries = hasRelocs
? new RelocEntry[relocs.Length]
: Array.Empty<RelocEntry>();
@ -1469,8 +1470,8 @@ namespace ARMeilleure.CodeGen.X86
_stream.CopyTo(codeStream);
var code = codeStream.ToArray();
var relocInfo = new RelocInfo(relocEntries);
byte[] code = codeStream.ToArray();
RelocInfo relocInfo = new RelocInfo(relocEntries);
return (code, relocInfo);
}