codebje commented on pull request #3170: URL: https://github.com/apache/incubator-nuttx/pull/3170#issuecomment-807678825
> It depends on how much space you required. For small variables(it's the normal case for libc), it's better to reserve the memory from stack directly, because each allocation(even you just need one byte) will consume at least 16 bytes plus the pointer space. and the complex initialization(mutex and allocate/free). The largest variable I'm aware of is: `./libs/libc/grp/lib_grp_globals.c:char g_group_buffer[GRPBUF_RESERVE_SIZE];` `GRPBUF_RESERVE_SIZE` depends on config settings. The default settings would make it 116 bytes on a platform with 32-bit pointers. There's also `g_passwd_buffer` with a default size of 80 bytes, so just those two would take up nearly 200 bytes. -- 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: [email protected]
