mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 06:59:32 +03:00
Merge branch 'master' into dev
This commit is contained in:
commit
a6c5e2cffd
1 changed files with 2 additions and 2 deletions
4
src/os.c
4
src/os.c
|
@ -93,7 +93,7 @@ void _mi_os_init(void) {
|
||||||
if (si.dwAllocationGranularity > 0) os_alloc_granularity = si.dwAllocationGranularity;
|
if (si.dwAllocationGranularity > 0) os_alloc_granularity = si.dwAllocationGranularity;
|
||||||
// get the VirtualAlloc2 function
|
// get the VirtualAlloc2 function
|
||||||
HINSTANCE hDll;
|
HINSTANCE hDll;
|
||||||
hDll = LoadLibrary("kernelbase.dll");
|
hDll = LoadLibrary(TEXT("kernelbase.dll"));
|
||||||
if (hDll != NULL) {
|
if (hDll != NULL) {
|
||||||
// use VirtualAlloc2FromApp as it is available to Windows store apps
|
// use VirtualAlloc2FromApp as it is available to Windows store apps
|
||||||
pVirtualAlloc2 = (VirtualAlloc2Ptr)GetProcAddress(hDll, "VirtualAlloc2FromApp");
|
pVirtualAlloc2 = (VirtualAlloc2Ptr)GetProcAddress(hDll, "VirtualAlloc2FromApp");
|
||||||
|
@ -110,7 +110,7 @@ void _mi_os_init(void) {
|
||||||
ok = OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token);
|
ok = OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
TOKEN_PRIVILEGES tp;
|
TOKEN_PRIVILEGES tp;
|
||||||
ok = LookupPrivilegeValue(NULL, "SeLockMemoryPrivilege", &tp.Privileges[0].Luid);
|
ok = LookupPrivilegeValue(NULL, TEXT("SeLockMemoryPrivilege"), &tp.Privileges[0].Luid);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
tp.PrivilegeCount = 1;
|
tp.PrivilegeCount = 1;
|
||||||
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
||||||
|
|
Loading…
Add table
Reference in a new issue