[PATCH v2 4/6] ntdll: Implement NtSetInformationVirtualMemory().

Akihiro Sagawa sagawa.aki at gmail.com
Sat Nov 27 05:55:58 CST 2021


On Fri, 26 Nov 2021 23:50:31 +0900, Jinoh Kang wrote:
(...)
> +    for (i = 0; i < count; i++)
> +    {
> +        MEMORY_RANGE_ENTRY entry;
> +        memcpy(&entry, &addresses[i], sizeof(MEMORY_RANGE_ENTRY));
> +
> +        base = ROUND_ADDR( entry.VirtualAddress, page_mask );
> +        size = ROUND_SIZE( entry.VirtualAddress, entry.NumberOfBytes );
> +
> +#ifdef HAVE_MADVISE
> +        madvise(base, size, MADV_WILLNEED);
> +#else
> +        (void)base;
> +        (void)size;
> +#endif
> +    }
> +
> +    return STATUS_SUCCESS;
> +}

Hello Jinoh,
From my point of view, you may want to remove autoconf fragments.
This is because madvise(2) is already used in dlls/ntdll/unix/virtual.c:3884
with MADV_DONTNEED and it comes from 4.4BSD.

Akihiro Sagawa




More information about the wine-devel mailing list