v01d commented on pull request #3170:
URL: https://github.com/apache/incubator-nuttx/pull/3170#issuecomment-806107822


   >     * can we explicitly reserve space for this TLS data? if we continue to 
use this procedure (or the user requests too much TLS data) pthread_key_create 
will fail which leads to hard-to-debug problems. Having to guess the right size 
of `CONFIG_TLS_NELEM` is quite cumbersome. I think that we could have the array 
be CONFIG_TLS_NELEM + TLS_NELEM_RESERVED to guarantee this never fails.
   
   Ideally, to me, pthread_key_create should grow an array so that we know if 
user never calls getopt(), no uneeded memory would be on the TLS struct. Is 
this possible? Or TLS struct needs to be of fixed size? Maybe we can have a 
single TLS entry as a pointer to a dynamic array of pointers, that could grow 
during runtime.
   


-- 
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]


Reply via email to