xiaoxiang781216 commented on PR #12406:
URL: https://github.com/apache/nuttx/pull/12406#issuecomment-2134393784

   > > what's benefit to reclaim the signal action pool? if it's important to 
safe the memory, it's simpler and fast to alloc/free one action from heap.
   > 
   > @xiaoxiang781216 thanks for the comment. I watched 120*16=1920 bytes 
memory growth from ostest on `rv-virt/nsh`. This concerned me in the past and 
may scare new comers in the future. When reviewing the source, I saw comments 
in ostest like `/* Just exit, the system should clean up the signal handlers 
*/` in ostest and the system doesn't do reclamation, so I added it.
   > 
   
   But the change makes nxsig_release_action is slower than kmm_free. If so, 
why not remove the pool and call kmm_malloc/kmm_free direcctly?
   
   > On the other side, can I learn the benefit of this pool over the direct 
alloc/free of single entries approach? how the pool size is controlled? Why 
this pool doesn't use flags ` sigalloc_e` like other ones?
   
   If you want to save the memory, please study how net conn manage the socket 
handle:
   https://github.com/apache/nuttx/blob/master/net/icmp/icmp_conn.c#L77-L204


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to