make stacksize more portable
This commit is contained in:
parent
85d25798a5
commit
b5ba31501c
@ -599,7 +599,7 @@ AC_ARG_ENABLE([stacksize],
|
|||||||
if test "$ENABLED_STACKSIZE" = "yes"
|
if test "$ENABLED_STACKSIZE" = "yes"
|
||||||
then
|
then
|
||||||
AC_CHECK_FUNC([posix_memalign], [], [AC_MSG_ERROR(stacksize needs posix_memalign)])
|
AC_CHECK_FUNC([posix_memalign], [], [AC_MSG_ERROR(stacksize needs posix_memalign)])
|
||||||
AC_CHECK_FUNC([pthread_attr_setstack], [], [AC_MSG_ERROR(stacksize needs pthread_attr_setstack)])
|
AC_CHECK_FUNC([pthread_attr_setstack], [], AC_CHECK_LIB([pthread],[pthread_attr_setstack]))
|
||||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_STACK_SIZE -DCYASSL_LOW_MEMORY"
|
AM_CFLAGS="$AM_CFLAGS -DHAVE_STACK_SIZE -DCYASSL_LOW_MEMORY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1206,7 +1206,7 @@ static INLINE void StackSizeCheck(func_args* args, thread_func tf)
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
err_sys("posix_memalign failed\n");
|
err_sys("posix_memalign failed\n");
|
||||||
|
|
||||||
memset(myStack, 0xee, stackSize);
|
memset(myStack, 0x01, stackSize);
|
||||||
|
|
||||||
ret = pthread_attr_init(&myAttr);
|
ret = pthread_attr_init(&myAttr);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
@ -1227,7 +1227,7 @@ static INLINE void StackSizeCheck(func_args* args, thread_func tf)
|
|||||||
err_sys("pthread_join failed");
|
err_sys("pthread_join failed");
|
||||||
|
|
||||||
for (i = 0; i < stackSize; i++) {
|
for (i = 0; i < stackSize; i++) {
|
||||||
if (myStack[i] != 0xee) {
|
if (myStack[i] != 0x01) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user