yamt commented on a change in pull request #3546: URL: https://github.com/apache/incubator-nuttx/pull/3546#discussion_r613649367
########## File path: libs/libc/modlib/modlib_load.c ########## @@ -271,16 +293,29 @@ int modlib_load(FAR struct mod_loadinfo_s *loadinfo) } } #else - loadinfo->textalloc = (uintptr_t)lib_malloc(loadinfo->textsize + - loadinfo->datasize); + align = loadinfo->textalign; + if (align < loadinfo->dataalign) + { + align = loadinfo->dataalign; + } + + text_size = loadinfo->textsize; + if (loadinfo->datasize > 0) + { + text_size = _ALIGN_UP(text_size, loadinfo->dataalign); + } + + loadinfo->textalloc = (uintptr_t)lib_memalign(align, Review comment: i'm ok with making it always use separate allocations. do you want me to do it in this PR? i'm feeling that a separate PR is more appropriate. -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org