mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 15:09:31 +03:00
merge
This commit is contained in:
parent
219d46ff0c
commit
0b4d74a566
2 changed files with 3 additions and 3 deletions
|
@ -19,6 +19,7 @@ terms of the MIT license. A copy of the license can be found in the file
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h> // memcpy
|
#include <string.h> // memcpy
|
||||||
|
#include <stdlib.h> // getenv
|
||||||
|
|
||||||
#ifndef EINVAL
|
#ifndef EINVAL
|
||||||
#define EINVAL 22
|
#define EINVAL 22
|
||||||
|
@ -146,4 +147,3 @@ int mi_wdupenv_s(unsigned short** buf, size_t* size, const unsigned short* name)
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ static DWORD WINAPI thread_entry(LPVOID param) {
|
||||||
static void run_os_threads(size_t nthreads) {
|
static void run_os_threads(size_t nthreads) {
|
||||||
DWORD* tids = (DWORD*)malloc(nthreads * sizeof(DWORD));
|
DWORD* tids = (DWORD*)malloc(nthreads * sizeof(DWORD));
|
||||||
HANDLE* thandles = (HANDLE*)malloc(nthreads * sizeof(HANDLE));
|
HANDLE* thandles = (HANDLE*)malloc(nthreads * sizeof(HANDLE));
|
||||||
for (intptr_t i = 0; i < nthreads; i++) {
|
for (uintptr_t i = 0; i < nthreads; i++) {
|
||||||
thandles[i] = CreateThread(0, 4096, &thread_entry, (void*)(i), 0, &tids[i]);
|
thandles[i] = CreateThread(0, 4096, &thread_entry, (void*)(i), 0, &tids[i]);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < nthreads; i++) {
|
for (int i = 0; i < nthreads; i++) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue