aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/debug.cc22
-rw-r--r--libstdc++-v3/src/mt_allocator.cc26
2 files changed, 21 insertions, 27 deletions
diff --git a/libstdc++-v3/src/debug.cc b/libstdc++-v3/src/debug.cc
index d3935842..be5ba01 100644
--- a/libstdc++-v3/src/debug.cc
+++ b/libstdc++-v3/src/debug.cc
@@ -587,7 +587,7 @@ namespace __gnu_debug
_M_print_string(const char* __string) const
{
const char* __start = __string;
- const char* __end = __start;
+ const char* __finish = __start;
const int __bufsize = 128;
char __buf[__bufsize];
@@ -595,21 +595,21 @@ namespace __gnu_debug
{
if (*__start != '%')
{
- // [__start, __end) denotes the next word
- __end = __start;
- while (isalnum(*__end))
- ++__end;
- if (__start == __end)
- ++__end;
- if (isspace(*__end))
- ++__end;
+ // [__start, __finish) denotes the next word
+ __finish = __start;
+ while (isalnum(*__finish))
+ ++__finish;
+ if (__start == __finish)
+ ++__finish;
+ if (isspace(*__finish))
+ ++__finish;
- const ptrdiff_t __len = __end - __start;
+ const ptrdiff_t __len = __finish - __start;
assert(__len < __bufsize);
memcpy(__buf, __start, __len);
__buf[__len] = '\0';
_M_print_word(__buf);
- __start = __end;
+ __start = __finish;
// Skip extra whitespace
while (*__start == ' ')
diff --git a/libstdc++-v3/src/mt_allocator.cc b/libstdc++-v3/src/mt_allocator.cc
index 4385fbc..da0b09c 100644
--- a/libstdc++-v3/src/mt_allocator.cc
+++ b/libstdc++-v3/src/mt_allocator.cc
@@ -423,7 +423,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__bin._M_address = __address;
char* __c = static_cast<char*>(__v) + sizeof(_Block_address);
- _Block_record* __block = reinterpret_cast<_Block_record*>(__c);
+ __block = reinterpret_cast<_Block_record*>(__c);
__bin._M_first[0] = __block;
while (--__block_count > 0)
{
@@ -505,8 +505,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
const size_t __k = sizeof(_Thread_record)
* _M_options._M_max_threads;
__v = ::operator new(__k);
- _Thread_record* _M_thread_freelist
- = static_cast<_Thread_record*>(__v);
+ _M_thread_freelist = static_cast<_Thread_record*>(__v);
// NOTE! The first assignable thread id is 1 since the
// global pool uses id 0
@@ -528,8 +527,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// _M_thread_freelist.
__gthread_key_create(&freelist._M_key,
::_M_destroy_thread_key);
- freelist._M_thread_freelist
- = _M_thread_freelist;
+ freelist._M_thread_freelist = _M_thread_freelist;
}
else
{
@@ -552,10 +550,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
::operator delete(static_cast<void*>(_M_old_array));
}
- freelist._M_thread_freelist_array
- = _M_thread_freelist;
- freelist._M_max_threads
- = _M_options._M_max_threads;
+ freelist._M_thread_freelist_array = _M_thread_freelist;
+ freelist._M_max_threads = _M_options._M_max_threads;
}
}
@@ -570,7 +566,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__bin._M_address = NULL;
__v = ::operator new(sizeof(size_t) * __max_threads);
- std::memset(__v, 0, sizeof(size_t) * __max_threads);
+ std::memset(__v, 0, sizeof(size_t) * __max_threads);
+
__bin._M_free = static_cast<size_t*>(__v);
__v = ::operator new(sizeof(size_t) * __max_threads
@@ -630,8 +627,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
}
- __gthread_setspecific(freelist._M_key,
- (void*)_M_id);
+ __gthread_setspecific(freelist._M_key, (void*)_M_id);
}
return _M_id >= _M_options._M_max_threads ? 0 : _M_id;
}
@@ -697,14 +693,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__gnu_cxx::__scoped_lock sentry(freelist_mutex);
if (!freelist._M_thread_freelist_array
- || freelist._M_max_threads
- < _M_options._M_max_threads)
+ || freelist._M_max_threads < _M_options._M_max_threads)
{
const size_t __k = sizeof(_Thread_record)
* _M_options._M_max_threads;
__v = ::operator new(__k);
- _Thread_record* _M_thread_freelist
- = static_cast<_Thread_record*>(__v);
+ _M_thread_freelist = static_cast<_Thread_record*>(__v);
// NOTE! The first assignable thread id is 1 since the
// global pool uses id 0