make stacksize more portable

This commit is contained in:
toddouska 2013-06-19 12:56:25 -07:00
parent 85d25798a5
commit b5ba31501c
2 changed files with 3 additions and 3 deletions

View File

@ -599,7 +599,7 @@ AC_ARG_ENABLE([stacksize],
if test "$ENABLED_STACKSIZE" = "yes"
then
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"
fi

View File

@ -1206,7 +1206,7 @@ static INLINE void StackSizeCheck(func_args* args, thread_func tf)
if (ret != 0)
err_sys("posix_memalign failed\n");
memset(myStack, 0xee, stackSize);
memset(myStack, 0x01, stackSize);
ret = pthread_attr_init(&myAttr);
if (ret != 0)
@ -1227,7 +1227,7 @@ static INLINE void StackSizeCheck(func_args* args, thread_func tf)
err_sys("pthread_join failed");
for (i = 0; i < stackSize; i++) {
if (myStack[i] != 0xee) {
if (myStack[i] != 0x01) {
break;
}
}