mardi 16 avril 2019

Does a thread_local std::list give up the allocated memory on calling clear?

What happens when we call clear on a variable of type std::list which is also marked thread_local? Does it give up the allocated memory?

In my scenario I have a thread_local list which I populate in one iteration and clear by the end of the iteration. Is the thread_local not very useful in such a case as we give up the memory by the end of the iteration (and have to allocate memory again in the next iteration)?

Aucun commentaire:

Enregistrer un commentaire