Skip to content

Commit 60b7ce6

Browse files
Paul Gofmanivyl
Paul Gofman
authored andcommitted
ntdll: Add WINE_DISABLE_WRITE_WATCH env var to disable write watch support.
Massively improves performance for corert games (Streets of Rage 4). Could be fixed properly with Linux kernel changes.
1 parent af8ab05 commit 60b7ce6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

dlls/ntdll/unix/virtual.c

+16
Original file line numberDiff line numberDiff line change
@@ -4523,6 +4523,22 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
45234523
SIZE_T size = *size_ptr;
45244524
NTSTATUS status = STATUS_SUCCESS;
45254525

4526+
if (type & MEM_WRITE_WATCH)
4527+
{
4528+
static int disable = -1;
4529+
4530+
if (disable == -1)
4531+
{
4532+
const char *env_var;
4533+
4534+
if ((disable = (env_var = getenv("WINE_DISABLE_WRITE_WATCH")) && atoi(env_var)))
4535+
FIXME("Disabling write watch support.\n");
4536+
}
4537+
4538+
if (disable)
4539+
return STATUS_NOT_SUPPORTED;
4540+
}
4541+
45264542
/* Round parameters to a page boundary */
45274543

45284544
if (is_beyond_limit( 0, size, working_set_limit )) return STATUS_WORKING_SET_LIMIT_RANGE;

0 commit comments

Comments
 (0)