@@ -3668,11 +3668,13 @@ char* mystrnstr(const char* s1, const char* s2, unsigned int n)
36683668
36693669#elif defined(WOLFSSL_ZEPHYR )
36703670
3671+ void * wolfsslThreadHeapHint = NULL ;
3672+
36713673 int wolfSSL_NewThread (THREAD_TYPE * thread ,
36723674 THREAD_CB cb , void * arg )
36733675 {
36743676 #ifndef WOLFSSL_ZEPHYR_STACK_SZ
3675- #define WOLFSSL_ZEPHYR_STACK_SZ (24 *1024)
3677+ #define WOLFSSL_ZEPHYR_STACK_SZ (48 *1024)
36763678 #endif
36773679
36783680 if (thread == NULL || cb == NULL )
@@ -3686,10 +3688,12 @@ char* mystrnstr(const char* s1, const char* s2, unsigned int n)
36863688 * 0);
36873689 */
36883690 thread -> threadStack = (void * )XMALLOC (
3689- Z_KERNEL_STACK_SIZE_ADJUST (WOLFSSL_ZEPHYR_STACK_SZ ), 0 ,
3690- DYNAMIC_TYPE_TMP_BUFFER );
3691- if (thread -> threadStack == NULL )
3691+ Z_KERNEL_STACK_SIZE_ADJUST (WOLFSSL_ZEPHYR_STACK_SZ ),
3692+ wolfsslThreadHeapHint , DYNAMIC_TYPE_TMP_BUFFER );
3693+ if (thread -> threadStack == NULL ) {
3694+ WOLFSSL_MSG ("error: XMALLOC failed" );
36923695 return MEMORY_E ;
3696+ }
36933697
36943698 /* k_thread_create does not return any error codes */
36953699 /* Casting to k_thread_entry_t should be fine since we just ignore the
@@ -3716,7 +3720,8 @@ char* mystrnstr(const char* s1, const char* s2, unsigned int n)
37163720 * if (err != 0)
37173721 * ret = MEMORY_E;
37183722 */
3719- XFREE (thread .threadStack , NULL , DYNAMIC_TYPE_TMP_BUFFER );
3723+ XFREE (thread .threadStack , wolfsslThreadHeapHint ,
3724+ DYNAMIC_TYPE_TMP_BUFFER );
37203725 thread .threadStack = NULL ;
37213726
37223727 /* No thread resources to free. Everything is stored in thread.tid */
0 commit comments