Update llama-util.h
Avoid duplicate function signature as requested
This commit is contained in:
parent
ac27ac75ac
commit
b684583f0c
1 changed files with 3 additions and 4 deletions
|
@ -275,16 +275,15 @@ struct llama_mmap {
|
||||||
if (prefetch) {
|
if (prefetch) {
|
||||||
// The PrefetchVirtualMemory API is only present on Windows 8 and above, so we
|
// The PrefetchVirtualMemory API is only present on Windows 8 and above, so we
|
||||||
// will dynamically load it using GetProcAddress.
|
// will dynamically load it using GetProcAddress.
|
||||||
BOOL (WINAPI *pPrefetchVirtualMemory) (HANDLE, ULONG_PTR, PWIN32_MEMORY_RANGE_ENTRY, ULONG);
|
typedef BOOL (WINAPI *PPREFETCHVIRTUALMEMORY) (HANDLE, ULONG_PTR, PWIN32_MEMORY_RANGE_ENTRY, ULONG);
|
||||||
|
PPREFETCHVIRTUALMEMORY pPrefetchVirtualMemory;
|
||||||
HMODULE hKernel32;
|
HMODULE hKernel32;
|
||||||
|
|
||||||
// This call is guaranteed to succeed.
|
// This call is guaranteed to succeed.
|
||||||
hKernel32 = GetModuleHandleW(L"kernel32.dll");
|
hKernel32 = GetModuleHandleW(L"kernel32.dll");
|
||||||
|
|
||||||
// This call may fail if on a pre-Win8 system.
|
// This call may fail if on a pre-Win8 system.
|
||||||
pPrefetchVirtualMemory =
|
pPrefetchVirtualMemory = (PPREFETCHVIRTUALMEMORY) GetProcAddress(hKernel32, "PrefetchVirtualMemory");
|
||||||
(BOOL (WINAPI *) (HANDLE, ULONG_PTR, PWIN32_MEMORY_RANGE_ENTRY, ULONG))
|
|
||||||
GetProcAddress(hKernel32, "PrefetchVirtualMemory");
|
|
||||||
|
|
||||||
if (pPrefetchVirtualMemory) {
|
if (pPrefetchVirtualMemory) {
|
||||||
// Advise the kernel to preload the mapped memory.
|
// Advise the kernel to preload the mapped memory.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue