Are there any risks to using stdlib qsort() on an MQX 4.2 Kinetis K60 system?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Are there any risks to using stdlib qsort() on an MQX 4.2 Kinetis K60 system?

ソリューションへジャンプ
1,184件の閲覧回数
dmitriyc
Contributor III

Hello,

I would like to sort an array of structs and the qsort() in stdlib.h looks like a good solution as opposed to rolling my own sort function. I don't need that much speed, so the generic standard function should be fine for this. Are there any dangers in doing this? For example, is the qsort() implemented as a recursive function, creating the need to be very careful with the task's stack size?

Has anyone else had experience using qsort in an MQX system?

タグ(2)
0 件の賞賛
返信
1 解決策
965件の閲覧回数
Carlos_Musich
NXP Employee
NXP Employee

Hi dmitriyc,

As you say... You must be very careful with the task stack. I have not tried qsort() or other recursive functions. But in my experience I saw that printf() using floats will overflow a task's stack very fast.


Best regards,
Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
966件の閲覧回数
Carlos_Musich
NXP Employee
NXP Employee

Hi dmitriyc,

As you say... You must be very careful with the task stack. I have not tried qsort() or other recursive functions. But in my experience I saw that printf() using floats will overflow a task's stack very fast.


Best regards,
Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信