Skip to content

Commit

Permalink
ntdll: Add WINE_DISABLE_WRITE_WATCH env var to disable write watch su…
Browse files Browse the repository at this point in the history
…pport.

Massively improves performance for corert games (Streets of Rage 4).
Could be fixed properly with Linux kernel changes.
  • Loading branch information
Paul Gofman authored and ivyl committed Feb 15, 2024
1 parent af8ab05 commit 60b7ce6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dlls/ntdll/unix/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -4523,6 +4523,22 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
SIZE_T size = *size_ptr;
NTSTATUS status = STATUS_SUCCESS;

if (type & MEM_WRITE_WATCH)
{
static int disable = -1;

if (disable == -1)
{
const char *env_var;

if ((disable = (env_var = getenv("WINE_DISABLE_WRITE_WATCH")) && atoi(env_var)))
FIXME("Disabling write watch support.\n");
}

if (disable)
return STATUS_NOT_SUPPORTED;
}

/* Round parameters to a page boundary */

if (is_beyond_limit( 0, size, working_set_limit )) return STATUS_WORKING_SET_LIMIT_RANGE;
Expand Down

0 comments on commit 60b7ce6

Please sign in to comment.