From 8790b8780fdccb39ed6b9b921ddc86495490bcde Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 1 Jun 2021 18:55:49 -0500 Subject: [PATCH] Rebase against 96030ce738aa20f85a5138ec7c231c19a086f019. --- patches/patchinstall.sh | 13 ---- ...-async-ws2_async_io-structures-if-po.patch | 62 ------------------- staging/upstream-commit | 2 +- 3 files changed, 1 insertion(+), 76 deletions(-) delete mode 100644 patches/ws2_32-APC_Performance/0001-ws2_32-Reuse-old-async-ws2_async_io-structures-if-po.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 004aac61..0c882444 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -280,7 +280,6 @@ patch_enable_all () enable_winmm_mciSendCommandA="$1" enable_wintab32_improvements="$1" enable_wintrust_WTHelperGetProvCertFromChain="$1" - enable_ws2_32_APC_Performance="$1" enable_ws2_32_Connect_Time="$1" enable_ws2_32_getsockopt="$1" enable_wscript_support_d_u_switches="$1" @@ -887,9 +886,6 @@ patch_enable () wintrust-WTHelperGetProvCertFromChain) enable_wintrust_WTHelperGetProvCertFromChain="$2" ;; - ws2_32-APC_Performance) - enable_ws2_32_APC_Performance="$2" - ;; ws2_32-Connect_Time) enable_ws2_32_Connect_Time="$2" ;; @@ -4208,15 +4204,6 @@ if test "$enable_wintrust_WTHelperGetProvCertFromChain" -eq 1; then patch_apply wintrust-WTHelperGetProvCertFromChain/0001-wintrust-Add-parameter-check-in-WTHelperGetProvCertF.patch fi -# Patchset ws2_32-APC_Performance -# | -# | Modified files: -# | * dlls/ws2_32/socket.c -# | -if test "$enable_ws2_32_APC_Performance" -eq 1; then - patch_apply ws2_32-APC_Performance/0001-ws2_32-Reuse-old-async-ws2_async_io-structures-if-po.patch -fi - # Patchset ws2_32-Connect_Time # | # | Modified files: diff --git a/patches/ws2_32-APC_Performance/0001-ws2_32-Reuse-old-async-ws2_async_io-structures-if-po.patch b/patches/ws2_32-APC_Performance/0001-ws2_32-Reuse-old-async-ws2_async_io-structures-if-po.patch deleted file mode 100644 index d3f022f9..00000000 --- a/patches/ws2_32-APC_Performance/0001-ws2_32-Reuse-old-async-ws2_async_io-structures-if-po.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 18d0ea3aec53d25ba5673576093c1acbc9289f9d Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Tue, 3 Mar 2015 19:20:40 +0100 -Subject: ws2_32: Reuse old async ws2_async_io structures if possible. - ---- - dlls/ws2_32/socket.c | 28 +++++++++++++++++++++------- - 1 file changed, 21 insertions(+), 7 deletions(-) - -diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c -index 8f11dd8ce7..ae20bd03f3 100644 ---- a/dlls/ws2_32/socket.c -+++ b/dlls/ws2_32/socket.c -@@ -476,6 +476,7 @@ struct ws2_async_io - { - async_callback_t *callback; /* must be the first field */ - struct ws2_async_io *next; -+ DWORD size; - }; - - struct ws2_async_shutdown -@@ -551,17 +552,30 @@ static struct ws2_async_io *alloc_async_io( DWORD size, async_callback_t callbac - { - /* first free remaining previous fileinfos */ - -- struct ws2_async_io *io = InterlockedExchangePointer( (void **)&async_io_freelist, NULL ); -+ struct ws2_async_io *old_io = InterlockedExchangePointer( (void **)&async_io_freelist, NULL ); -+ struct ws2_async_io *io = NULL; - -- while (io) -+ while (old_io) - { -- struct ws2_async_io *next = io->next; -- HeapFree( GetProcessHeap(), 0, 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 ws2_async_io *next = old_io->next; -+ HeapFree( GetProcessHeap(), 0, old_io ); -+ old_io = next; -+ } - } - -- io = HeapAlloc( GetProcessHeap(), 0, size ); -- if (io) io->callback = callback; -+ if (io || (io = HeapAlloc( GetProcessHeap(), 0, size ))) -+ { -+ io->callback = callback; -+ io->size = size; -+ } - return io; - } - --- -2.11.0 - diff --git a/staging/upstream-commit b/staging/upstream-commit index 445c7ef2..087aa59d 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -211da181c9140541ab7f7fcfa479367b3f7783eb +96030ce738aa20f85a5138ec7c231c19a086f019