crafcat7 opened a new pull request, #14137: URL: https://github.com/apache/nuttx/pull/14137
## Summary **Why is this change necessary?** After https://github.com/apache/nuttx/pull/13722, we found that some variables in vfs are stored in memory through strdup / asprintf. In order to keep the original intention of fs_heap as much as possible, we changed their usage to fs_heap_xxx to avoid the potential allocation and release in different heap regions. **Changes** We searched for all uses of strdup / asprintf in nuttx/fs and changed them to equivalent functions through fs_heap_malloc ## Impact **Is a new feature added?:** NO **Impact on build:** NO **Impact on hardware:** NO, this change does not specifically target any particular hardware architectures or boards. **Impact on documentation:** NO,This patch does not introduce any new features **Impact on compatibility:** This implementation aims to be backward compatible. No existing functionality is expected to be broken. ## Testing Build Host(s): Linux x86 Target(s): sim/nsh It can pass in our FS related test cases ``` [==========] nuttx_fs_test_suites: Running 40 test(s). [ RUN ] test_nuttx_fs_creat01 [ OK ] test_nuttx_fs_creat01 [ RUN ] test_nuttx_fs_dup01 [ OK ] test_nuttx_fs_dup01 [ RUN ] test_nuttx_fs_fcntl01 [ OK ] test_nuttx_fs_fcntl01 [ RUN ] test_nuttx_fs_fstat01 [ OK ] test_nuttx_fs_fstat01 [ RUN ] test_nuttx_fs_fstatfs01 [ OK ] test_nuttx_fs_fstatfs01 [ RUN ] test_nuttx_fs_fsync01 [ OK ] test_nuttx_fs_fsync01 [ RUN ] test_nuttx_fs_fsync02 the bsize = 4096 [ OK ] test_nuttx_fs_fsync02 [ RUN ] test_nuttx_fs_getfilep01 [ OK ] test_nuttx_fs_getfilep01 [ RUN ] test_nuttx_fs_mkdir01 [ OK ] test_nuttx_fs_mkdir01 [ RUN ] test_nuttx_fs_open01 [ OK ] test_nuttx_fs_open01 [ RUN ] test_nuttx_fs_opendir01 [ OK ] test_nuttx_fs_opendir01 [ RUN ] test_nuttx_fs_opendir02 [ OK ] test_nuttx_fs_opendir02 [ RUN ] test_nuttx_fs_pread01 [ OK ] test_nuttx_fs_pread01 [ RUN ] test_nuttx_fs_pwrite01 [ OK ] test_nuttx_fs_pwrite01 [ RUN ] test_nuttx_fs_readdir01 [ OK ] test_nuttx_fs_readdir01 [ RUN ] test_nuttx_fs_readlink01 [ OK ] test_nuttx_fs_readlink01 [ RUN ] test_nuttx_fs_rename01 [ OK ] test_nuttx_fs_rename01 [ RUN ] test_nuttx_fs_rename02 [ OK ] test_nuttx_fs_rename02 [ RUN ] test_nuttx_fs_rewinddir01 [ OK ] test_nuttx_fs_rewinddir01 [ RUN ] test_nuttx_fs_fmdir01 [ OK ] test_nuttx_fs_fmdir01 [ RUN ] test_nuttx_fs_rmdir02 [ OK ] test_nuttx_fs_rmdir02 [ RUN ] test_nuttx_fs_rmdir03 [ OK ] test_nuttx_fs_rmdir03 [ RUN ] test_nuttx_fs_seek01 [ OK ] test_nuttx_fs_seek01 [ RUN ] test_nuttx_fs_seek02 [ OK ] test_nuttx_fs_seek02 [ RUN ] test_nuttx_fs_statfs01 [ OK ] test_nuttx_fs_statfs01 [ RUN ] test_nuttx_fs_symlink01 [ OK ] test_nuttx_fs_symlink01 [ RUN ] test_nuttx_fs_truncate01 [ OK ] test_nuttx_fs_truncate01 [ RUN ] test_nuttx_fs_unlink01 [ OK ] test_nuttx_fs_unlink01 [ RUN ] test_nuttx_fs_write01 [ OK ] test_nuttx_fs_write01 [ RUN ] test_nuttx_fs_write02 [ OK ] test_nuttx_fs_write02 [ RUN ] test_nuttx_fs_write03 [ OK ] test_nuttx_fs_write03 [ RUN ] test_nuttx_fs_append01 [ OK ] test_nuttx_fs_append01 [ RUN ] test_nuttx_fs_sendfile01 [ OK ] test_nuttx_fs_sendfile01 [ RUN ] test_nuttx_fs_sendfile02 [ OK ] test_nuttx_fs_sendfile02 [ RUN ] test_nuttx_fs_stream01 [ OK ] test_nuttx_fs_stream01 [ RUN ] test_nuttx_fs_stream02 [ OK ] test_nuttx_fs_stream02 [ RUN ] test_nuttx_fs_stream03 [ OK ] test_nuttx_fs_stream03 [ RUN ] test_nuttx_fs_stream04 [ OK ] test_nuttx_fs_stream04 [ RUN ] test_nuttx_fs_eventfd [ OK ] test_nuttx_fs_eventfd [ RUN ] test_nuttx_fs_poll01 [ OK ] test_nuttx_fs_poll01 [==========] nuttx_fs_test_suites: 40 test(s) run. [ PASSED ] 40 test(s). ``` -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org