This commit is contained in:
Ottermandias 2024-07-22 20:54:24 +02:00
parent 528e3226b5
commit df33557477
2 changed files with 11 additions and 13 deletions

@ -1 +1 @@
Subproject commit f4c6144ca2012b279e6d8aa52b2bef6cc2ba32d9 Subproject commit 86249598afb71601b247f9629d9c29dbecfe6eb1

View file

@ -158,9 +158,7 @@ public sealed class PapRewriter(PapRewriter.PapResourceHandlerPrototype papResou
// Then we ensure we have a unique identifier for the specific variable location of that specific function // Then we ensure we have a unique identifier for the specific variable location of that specific function
// This is useful because sometimes the stack address is reused within the same function for different GetResourceAsync calls // This is useful because sometimes the stack address is reused within the same function for different GetResourceAsync calls
private unsafe nint NativeAllocPath(nint funcAddress, Register stackRegister, ulong stackDisplacement, nuint size) private unsafe nint NativeAllocPath(nint funcAddress, Register stackRegister, ulong stackDisplacement, nuint size)
{ => _nativeAllocPaths.GetOrAdd((funcAddress, stackRegister, stackDisplacement), _ => (nint)NativeMemory.Alloc(size));
return _nativeAllocPaths.GetOrAdd((funcAddress, stackRegister, stackDisplacement), _ => (nint)NativeMemory.Alloc(size));
}
private static unsafe void NativeFree(nint mem) private static unsafe void NativeFree(nint mem)
=> NativeMemory.Free((void*)mem); => NativeMemory.Free((void*)mem);