This reportedly alleviates stutter when joining a match in Forza Horizon 5.
From: Sebastian Lackner sebastian@fds-team.de
This reportedly alleviates stutter when joining a match in Forza Horizon 5. --- dlls/ntdll/unix/file.c | 23 +++++++++++++++++------ dlls/ntdll/unix/unix_private.h | 1 + 2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index eca75b2d4fb..2507120ab91 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -4890,18 +4890,29 @@ void release_fileio( struct async_fileio *io ) struct async_fileio *alloc_fileio( DWORD size, async_callback_t callback, HANDLE handle ) { /* first free remaining previous fileinfos */ - struct async_fileio *io = InterlockedExchangePointer( (void **)&fileio_freelist, NULL ); + struct async_fileio *old_io = InterlockedExchangePointer( (void **)&fileio_freelist, NULL ); + struct async_fileio *io = NULL;
- while (io) + while (old_io) { - struct async_fileio *next = io->next; - free( io ); - io = next; + if (!io && old_io->size >= size && old_io->size <= max(4096, 4 * size)) + { + io = old_io; + size = old_io->size; + old_io = old_io->next; + } + else + { + struct async_fileio *next = old_io->next; + free( old_io ); + old_io = next; + } }
- if ((io = malloc( size ))) + if (io || (io = malloc( size ))) { io->callback = callback; + io->size = size; io->handle = handle; } return io; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index b803b1cef46..82aacbcb724 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -109,6 +109,7 @@ struct async_fileio { async_callback_t *callback; struct async_fileio *next; + DWORD size; HANDLE handle; };
This reportedly alleviates stutter when joining a match in Forza Horizon 5.
On retesting it seems the initial results were incorrect.
This merge request was closed by Zebediah Figura.