crafcat7 commented on PR #12969: URL: https://github.com/apache/nuttx/pull/12969#issuecomment-2295616226
> You're trading stack usage for heap fragmentation. I disagree with this approach because once your heap is to fragmented `malloc` would simply fail and your system most likely crashes. if you really want it I propose you make an optional kconfig symbol called i.e. `dynamic path allocation` lib_get_pathbuffer will initially request an address from a global stack, just like we use temporary variables, which will not cause memory fragmentation. Unless the current usage peak exceeds the available buffer, it will request from the heap. I think the fragmentation problem can be tuned with CONFIG_LIBC_MAX_PATHBUFFER, which can reduce/avoid malloc from heap -- 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]
