fix mac build and comment on stack size check
This commit is contained in:
committed by
Jyun-Yan You
parent
fdf48a7b52
commit
4f1d8cb6fc
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "rust_thread.h"
|
#include "rust_thread.h"
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
const size_t default_stack_sz = 1024*1024;
|
const size_t default_stack_sz = 1024*1024;
|
||||||
|
|
||||||
@@ -41,6 +42,8 @@ rust_thread::start() {
|
|||||||
#if defined(__WIN32__)
|
#if defined(__WIN32__)
|
||||||
thread = CreateThread(NULL, stack_sz, rust_thread_start, this, 0, NULL);
|
thread = CreateThread(NULL, stack_sz, rust_thread_start, this, 0, NULL);
|
||||||
#else
|
#else
|
||||||
|
// PTHREAD_STACK_MIN of some system is larger than default size
|
||||||
|
// so we check stack_sz to prevent assertion failure.
|
||||||
if (stack_sz < PTHREAD_STACK_MIN) {
|
if (stack_sz < PTHREAD_STACK_MIN) {
|
||||||
stack_sz = PTHREAD_STACK_MIN;
|
stack_sz = PTHREAD_STACK_MIN;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user