Fix data race setting size_left_ in ThreadCache::SetMaxSize

This commit is to fix the data race in ThreadCache::SetMaxSize.
ThreadCache::size_left_ is removed and ThreadCache::size_ is
added. ThreadCache::size_left_ was introduced for optimization.
It is updated in several functions of ThreadCache, including the
ThreadCache::SetMaxSize. But thread A can update size_left_ of
thread B via SetMaxSize without protection or synchronization.

There should not be data race around ThreadCache::size_, for it
isn't accessed by multi threads.

The optimization of tail-call in tc_{malloc, new, free} is kept
and no other logics are affected.
2 files changed