[Midnightbsd-cvs] src [9684] trunk/contrib/libstdc++: fix with clang
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Dec 16 00:24:34 EST 2017
Revision: 9684
http://svnweb.midnightbsd.org/src/?rev=9684
Author: laffer1
Date: 2017-12-16 00:24:33 -0500 (Sat, 16 Dec 2017)
Log Message:
-----------
fix with clang
Modified Paths:
--------------
trunk/contrib/libstdc++/config/abi/pre/gnu.ver
trunk/contrib/libstdc++/include/bits/basic_string.h
trunk/contrib/libstdc++/include/bits/basic_string.tcc
trunk/contrib/libstdc++/include/bits/cpp_type_traits.h
trunk/contrib/libstdc++/include/bits/stl_algobase.h
trunk/contrib/libstdc++/include/bits/stl_multimap.h
trunk/contrib/libstdc++/include/bits/stl_tree.h
trunk/contrib/libstdc++/include/bits/stl_vector.h
trunk/contrib/libstdc++/include/c_std/std_cmath.h
trunk/contrib/libstdc++/include/ext/hashtable.h
trunk/contrib/libstdc++/include/ext/mt_allocator.h
trunk/contrib/libstdc++/include/ext/throw_allocator.h
trunk/contrib/libstdc++/include/std/std_limits.h
trunk/contrib/libstdc++/libsupc++/eh_alloc.cc
trunk/contrib/libstdc++/libsupc++/unwind-cxx.h
trunk/contrib/libstdc++/src/mt_allocator.cc
Modified: trunk/contrib/libstdc++/config/abi/pre/gnu.ver
===================================================================
--- trunk/contrib/libstdc++/config/abi/pre/gnu.ver 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/config/abi/pre/gnu.ver 2017-12-16 05:24:33 UTC (rev 9684)
@@ -121,7 +121,7 @@
std::__moneypunct_cache*;
std::__numpunct_cache*;
std::__timepunct_cache*;
- __gnu_debug::_Error_formatter*
+ __gnu_debug::_Error_formatter*;
};
# Names not in an 'extern' block are mangled names.
@@ -604,34 +604,6 @@
} GLIBCXX_3.4.3;
GLIBCXX_3.4.5 {
-
- # std::string
- _ZNKSs11_M_disjunctEPKc;
- _ZNKSs15_M_check_lengthE[jm][jm]PKc;
- _ZNSs4_Rep26_M_set_length_and_sharableE*;
- _ZNSs7_M_copyEPcPKc[jm];
- _ZNSs7_M_moveEPcPKc[jm];
- _ZNSs9_M_assignEPc[jm]c;
-
- # std::wstring
- _ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw;
- _ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthE[jm][jm]PKc;
- _ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableE*;
- _ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKw[jm];
- _ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKw[jm];
- _ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPw[jm]w;
-
- _ZNKSt13basic_fstreamI[cw]St11char_traitsI[cw]EE7is_openEv;
- _ZNKSt14basic_ifstreamI[cw]St11char_traitsI[cw]EE7is_openEv;
- _ZNKSt14basic_ofstreamI[cw]St11char_traitsI[cw]EE7is_openEv;
-
- _ZNSi6ignoreE[ilv];
- _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreE[ilv];
-
- _ZNSt11char_traitsI[cw]E2eqERK[cw]S2_;
-
- _ZNSt19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEppEv;
-
} GLIBCXX_3.4.4;
GLIBCXX_3.4.6 {
@@ -643,8 +615,6 @@
_ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE9showmanycEv;
- _ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv;
-
_ZN9__gnu_cxx6__poolILb1EE13_M_initializeEv;
} GLIBCXX_3.4.5;
Modified: trunk/contrib/libstdc++/include/bits/basic_string.h
===================================================================
--- trunk/contrib/libstdc++/include/bits/basic_string.h 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/include/bits/basic_string.h 2017-12-16 05:24:33 UTC (rev 9684)
@@ -390,6 +390,16 @@
_S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
{ _M_copy(__p, __k1, __k2 - __k1); }
+ static int
+ _S_compare(size_type __x, size_type __y)
+ {
+ if (__x > __y)
+ return 1;
+ if (__x < __y)
+ return -1;
+ return 0;
+ }
+
void
_M_mutate(size_type __pos, size_type __len1, size_type __len2);
@@ -1934,7 +1944,7 @@
int __r = traits_type::compare(_M_data(), __str.data(), __len);
if (!__r)
- __r = __size - __osize;
+ __r = _S_compare(__size, __osize);
return __r;
}
Modified: trunk/contrib/libstdc++/include/bits/basic_string.tcc
===================================================================
--- trunk/contrib/libstdc++/include/bits/basic_string.tcc 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/include/bits/basic_string.tcc 2017-12-16 05:24:33 UTC (rev 9684)
@@ -903,7 +903,7 @@
const size_type __len = std::min(__n, __osize);
int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
if (!__r)
- __r = __n - __osize;
+ __r = _S_compare(__n, __osize);
return __r;
}
@@ -921,7 +921,7 @@
int __r = traits_type::compare(_M_data() + __pos1,
__str.data() + __pos2, __len);
if (!__r)
- __r = __n1 - __n2;
+ __r = _S_compare(__n1, __n2);
return __r;
}
@@ -936,7 +936,7 @@
const size_type __len = std::min(__size, __osize);
int __r = traits_type::compare(_M_data(), __s, __len);
if (!__r)
- __r = __size - __osize;
+ __r = _S_compare(__size, __osize);
return __r;
}
@@ -952,7 +952,7 @@
const size_type __len = std::min(__n1, __osize);
int __r = traits_type::compare(_M_data() + __pos, __s, __len);
if (!__r)
- __r = __n1 - __osize;
+ __r = _S_compare(__n1, __osize);
return __r;
}
@@ -968,7 +968,7 @@
const size_type __len = std::min(__n1, __n2);
int __r = traits_type::compare(_M_data() + __pos, __s, __len);
if (!__r)
- __r = __n1 - __n2;
+ __r = _S_compare(__n1, __n2);
return __r;
}
Modified: trunk/contrib/libstdc++/include/bits/cpp_type_traits.h
===================================================================
--- trunk/contrib/libstdc++/include/bits/cpp_type_traits.h 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/include/bits/cpp_type_traits.h 2017-12-16 05:24:33 UTC (rev 9684)
@@ -80,6 +80,13 @@
_GLIBCXX_BEGIN_NAMESPACE(std)
+#ifdef __clang__
+// When using clang, suppress warnings about possible keywords (such as
+// __is_void, __is_pod, etc) being used as identifiers.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wkeyword-compat"
+#endif
+
namespace __detail
{
// NB: g++ can not compile these if declared within the class
@@ -398,6 +405,10 @@
};
#endif
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
_GLIBCXX_END_NAMESPACE
#endif //_CPP_TYPE_TRAITS_H
Modified: trunk/contrib/libstdc++/include/bits/stl_algobase.h
===================================================================
--- trunk/contrib/libstdc++/include/bits/stl_algobase.h 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/include/bits/stl_algobase.h 2017-12-16 05:24:33 UTC (rev 9684)
@@ -373,7 +373,7 @@
* @param first An input iterator.
* @param last An input iterator.
* @param result An output iterator.
- * @return result + (first - last)
+ * @return result + (last - first)
*
* This inline function will boil down to a call to @c memmove whenever
* possible. Failing that, if random access iterators are passed, then the
Modified: trunk/contrib/libstdc++/include/bits/stl_multimap.h
===================================================================
--- trunk/contrib/libstdc++/include/bits/stl_multimap.h 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/include/bits/stl_multimap.h 2017-12-16 05:24:33 UTC (rev 9684)
@@ -185,7 +185,7 @@
template <typename _InputIterator>
multimap(_InputIterator __first, _InputIterator __last)
: _M_t()
- { _M_t._M_insert_unique(__first, __last); }
+ { _M_t._M_insert_equal(__first, __last); }
/**
* @brief Builds a %multimap from a range.
Modified: trunk/contrib/libstdc++/include/bits/stl_tree.h
===================================================================
--- trunk/contrib/libstdc++/include/bits/stl_tree.h 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/include/bits/stl_tree.h 2017-12-16 05:24:33 UTC (rev 9684)
@@ -64,6 +64,8 @@
#ifndef _TREE_H
#define _TREE_H 1
+#pragma GCC system_header
+
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/stl_construct.h>
Modified: trunk/contrib/libstdc++/include/bits/stl_vector.h
===================================================================
--- trunk/contrib/libstdc++/include/bits/stl_vector.h 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/include/bits/stl_vector.h 2017-12-16 05:24:33 UTC (rev 9684)
@@ -119,9 +119,12 @@
_Vector_base(size_t __n, const allocator_type& __a)
: _M_impl(__a)
{
- this->_M_impl._M_start = this->_M_allocate(__n);
- this->_M_impl._M_finish = this->_M_impl._M_start;
- this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ if (__n)
+ {
+ this->_M_impl._M_start = this->_M_allocate(__n);
+ this->_M_impl._M_finish = this->_M_impl._M_start;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ }
}
~_Vector_base()
Modified: trunk/contrib/libstdc++/include/c_std/std_cmath.h
===================================================================
--- trunk/contrib/libstdc++/include/c_std/std_cmath.h 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/include/c_std/std_cmath.h 2017-12-16 05:24:33 UTC (rev 9684)
@@ -589,6 +589,8 @@
{ return ::__gnu_cxx::__capture_isunordered(__f1, __f2); }
_GLIBCXX_END_NAMESPACE
+using std::isnan;
+using std::isinf;
#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
#endif
Modified: trunk/contrib/libstdc++/include/ext/hashtable.h
===================================================================
--- trunk/contrib/libstdc++/include/ext/hashtable.h 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/include/ext/hashtable.h 2017-12-16 05:24:33 UTC (rev 9684)
@@ -210,10 +210,11 @@
};
// Note: assumes long is at least 32 bits.
- enum { _S_num_primes = 28 };
+ enum { _S_num_primes = 29 };
static const unsigned long __stl_prime_list[_S_num_primes] =
{
+ 5ul, // 5ul mini size is a Google addition
53ul, 97ul, 193ul, 389ul, 769ul,
1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
@@ -1076,6 +1077,10 @@
hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
clear()
{
+ // Google addition: do not iterate over buckets when empty
+ if (_M_num_elements == 0)
+ return;
+
for (size_type __i = 0; __i < _M_buckets.size(); ++__i)
{
_Node* __cur = _M_buckets[__i];
Modified: trunk/contrib/libstdc++/include/ext/mt_allocator.h
===================================================================
--- trunk/contrib/libstdc++/include/ext/mt_allocator.h 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/include/ext/mt_allocator.h 2017-12-16 05:24:33 UTC (rev 9684)
@@ -342,12 +342,12 @@
{ return _M_bin[__which]; }
void
- _M_adjust_freelist(const _Bin_record& __bin, _Block_record* __block,
+ _M_adjust_freelist(const _Bin_record& __bin, _Block_record* __block_record,
size_t __thread_id)
{
if (__gthread_active_p())
{
- __block->_M_thread_id = __thread_id;
+ __block_record->_M_thread_id = __thread_id;
--__bin._M_free[__thread_id];
++__bin._M_used[__thread_id];
}
@@ -697,11 +697,11 @@
{
// Already reserved.
typedef typename __pool_type::_Block_record _Block_record;
- _Block_record* __block = __bin._M_first[__thread_id];
- __bin._M_first[__thread_id] = __block->_M_next;
+ _Block_record* __block_record = __bin._M_first[__thread_id];
+ __bin._M_first[__thread_id] = __block_record->_M_next;
- __pool._M_adjust_freelist(__bin, __block, __thread_id);
- __c = reinterpret_cast<char*>(__block) + __pool._M_get_align();
+ __pool._M_adjust_freelist(__bin, __block_record, __thread_id);
+ __c = reinterpret_cast<char*>(__block_record) + __pool._M_get_align();
}
else
{
Modified: trunk/contrib/libstdc++/include/ext/throw_allocator.h
===================================================================
--- trunk/contrib/libstdc++/include/ext/throw_allocator.h 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/include/ext/throw_allocator.h 2017-12-16 05:24:33 UTC (rev 9684)
@@ -423,11 +423,11 @@
s += buf;
s += tab;
s += "label: ";
- sprintf(buf, "%u", ref.second.first);
+ sprintf(buf, "%lu", ref.second.first);
s += buf;
s += tab;
s += "size: ";
- sprintf(buf, "%u", ref.second.second);
+ sprintf(buf, "%lu", ref.second.second);
s += buf;
s += '\n';
}
Modified: trunk/contrib/libstdc++/include/std/std_limits.h
===================================================================
--- trunk/contrib/libstdc++/include/std/std_limits.h 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/include/std/std_limits.h 2017-12-16 05:24:33 UTC (rev 9684)
@@ -134,10 +134,11 @@
#define __glibcxx_signed(T) ((T)(-1) < 0)
#define __glibcxx_min(T) \
- (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0)
+ (__glibcxx_signed (T) ? (((T)1 << (__glibcxx_digits (T) - 1)) << 1) : (T)0)
#define __glibcxx_max(T) \
- (__glibcxx_signed (T) ? ((T)1 << __glibcxx_digits (T)) - 1 : ~(T)0)
+ (__glibcxx_signed (T) ? \
+ (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0)
#define __glibcxx_digits(T) \
(sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T))
Modified: trunk/contrib/libstdc++/libsupc++/eh_alloc.cc
===================================================================
--- trunk/contrib/libstdc++/libsupc++/eh_alloc.cc 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/libsupc++/eh_alloc.cc 2017-12-16 05:24:33 UTC (rev 9684)
@@ -78,6 +78,14 @@
# define EMERGENCY_OBJ_COUNT 4
#endif
+/* APPLE LOCAL begin reduce emergency buffer size */
+/* 256 bytes is more than large enough for an std::bad_alloc object */
+#undef EMERGENCY_OBJ_SIZE
+#undef EMERGENCY_OBJ_COUNT
+#define EMERGENCY_OBJ_SIZE 256
+#define EMERGENCY_OBJ_COUNT 2
+/* APPLE LOCAL end reduce emergency buffer size */
+
#if INT_MAX == 32767 || EMERGENCY_OBJ_COUNT <= 32
typedef unsigned int bitmask_type;
#else
Modified: trunk/contrib/libstdc++/libsupc++/unwind-cxx.h
===================================================================
--- trunk/contrib/libstdc++/libsupc++/unwind-cxx.h 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/libsupc++/unwind-cxx.h 2017-12-16 05:24:33 UTC (rev 9684)
@@ -133,7 +133,7 @@
// throws, and if bad_exception needs to be thrown. Called from the
// compiler.
extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn));
-extern "C" void __cxa_call_terminate (void*) __attribute__((noreturn));
+extern "C" void __cxa_call_terminate (_Unwind_Exception*) __attribute__((noreturn));
#ifdef __ARM_EABI_UNWINDER__
// Arm EABI specified routines.
@@ -142,9 +142,9 @@
ctm_succeeded = 1,
ctm_succeeded_with_ptr_to_base = 2
} __cxa_type_match_result;
-extern "C" bool __cxa_type_match(_Unwind_Exception*, const std::type_info*,
+extern "C" __cxa_type_match_result __cxa_type_match(_Unwind_Exception*, const std::type_info*,
bool, void**);
-extern "C" void __cxa_begin_cleanup (_Unwind_Exception*);
+extern "C" bool __cxa_begin_cleanup (_Unwind_Exception*);
extern "C" void __cxa_end_cleanup (void);
#endif
@@ -173,7 +173,7 @@
return reinterpret_cast<__cxa_exception *>(exc + 1) - 1;
}
-#ifdef __ARM_EABI_UNWINDER__
+#if defined(__ARM_EABI_UNWINDER__) && !defined(__FreeBSD__)
static inline bool
__is_gxx_exception_class(_Unwind_Exception_Class c)
{
@@ -200,13 +200,7 @@
c[6] = '+';
c[7] = '\0';
}
-
-static inline void*
-__gxx_caught_object(_Unwind_Exception* eo)
-{
- return (void*)eo->barrier_cache.bitpattern[0];
-}
-#else // !__ARM_EABI_UNWINDER__
+#else // !__ARM_EABI_UNWINDER__ || __FreeBSD__
// This is the exception class we report -- "GNUCC++\0".
const _Unwind_Exception_Class __gxx_exception_class
= ((((((((_Unwind_Exception_Class) 'G'
@@ -223,9 +217,17 @@
{
return c == __gxx_exception_class;
}
-
#define __GXX_INIT_EXCEPTION_CLASS(c) c = __gxx_exception_class
+#endif
+#ifdef __ARM_EABI_UNWINDER__
+static inline void*
+__gxx_caught_object(_Unwind_Exception* eo)
+{
+ return (void*)eo->barrier_cache.bitpattern[0];
+}
+#else // !__ARM_EABI_UNWINDER__
+
// GNU C++ personality routine, Version 0.
extern "C" _Unwind_Reason_Code __gxx_personality_v0
(int, _Unwind_Action, _Unwind_Exception_Class,
Modified: trunk/contrib/libstdc++/src/mt_allocator.cc
===================================================================
--- trunk/contrib/libstdc++/src/mt_allocator.cc 2017-12-16 05:24:14 UTC (rev 9683)
+++ trunk/contrib/libstdc++/src/mt_allocator.cc 2017-12-16 05:24:33 UTC (rev 9684)
@@ -107,11 +107,11 @@
_Bin_record& __bin = _M_bin[__which];
char* __c = __p - _M_get_align();
- _Block_record* __block = reinterpret_cast<_Block_record*>(__c);
+ _Block_record* __block_record = reinterpret_cast<_Block_record*>(__c);
// Single threaded application - return to global pool.
- __block->_M_next = __bin._M_first[0];
- __bin._M_first[0] = __block;
+ __block_record->_M_next = __bin._M_first[0];
+ __bin._M_first[0] = __block_record;
}
char*
@@ -134,22 +134,22 @@
__bin._M_address = __address;
char* __c = static_cast<char*>(__v) + sizeof(_Block_address);
- _Block_record* __block = reinterpret_cast<_Block_record*>(__c);
- __bin._M_first[__thread_id] = __block;
+ _Block_record* __block_record = reinterpret_cast<_Block_record*>(__c);
+ __bin._M_first[__thread_id] = __block_record;
while (--__block_count > 0)
{
__c += __bin_size;
- __block->_M_next = reinterpret_cast<_Block_record*>(__c);
- __block = __block->_M_next;
+ __block_record->_M_next = reinterpret_cast<_Block_record*>(__c);
+ __block_record = __block_record->_M_next;
}
- __block->_M_next = NULL;
+ __block_record->_M_next = NULL;
- __block = __bin._M_first[__thread_id];
- __bin._M_first[__thread_id] = __block->_M_next;
+ __block_record = __bin._M_first[__thread_id];
+ __bin._M_first[__thread_id] = __block_record->_M_next;
// NB: For alignment reasons, we can't use the first _M_align
// bytes, even when sizeof(_Block_record) < _M_align.
- return reinterpret_cast<char*>(__block) + __options._M_align;
+ return reinterpret_cast<char*>(__block_record) + __options._M_align;
}
void
@@ -256,7 +256,7 @@
// Know __p not null, assume valid block.
char* __c = __p - _M_get_align();
- _Block_record* __block = reinterpret_cast<_Block_record*>(__c);
+ _Block_record* __block_record = reinterpret_cast<_Block_record*>(__c);
if (__gthread_active_p())
{
// Calculate the number of records to remove from our freelist:
@@ -313,13 +313,13 @@
// Return this block to our list and update counters and
// owner id as needed.
- if (__block->_M_thread_id == __thread_id)
+ if (__block_record->_M_thread_id == __thread_id)
--__bin._M_used[__thread_id];
else
- __atomic_add(&__reclaimed_base[__block->_M_thread_id], 1);
+ __atomic_add(&__reclaimed_base[__block_record->_M_thread_id], 1);
- __block->_M_next = __bin._M_first[__thread_id];
- __bin._M_first[__thread_id] = __block;
+ __block_record->_M_next = __bin._M_first[__thread_id];
+ __bin._M_first[__thread_id] = __block_record;
++__bin._M_free[__thread_id];
}
@@ -327,8 +327,8 @@
{
// Not using threads, so single threaded application - return
// to global pool.
- __block->_M_next = __bin._M_first[0];
- __bin._M_first[0] = __block;
+ __block_record->_M_next = __bin._M_first[0];
+ __bin._M_first[0] = __block_record;
}
}
@@ -354,7 +354,7 @@
// blocks on global list (and if not add new ones) and
// get the first one.
_Bin_record& __bin = _M_bin[__which];
- _Block_record* __block = NULL;
+ _Block_record* __block_record = NULL;
if (__gthread_active_p())
{
// Resync the _M_used counters.
@@ -378,16 +378,16 @@
// No need to hold the lock when we are adding a whole
// chunk to our own list.
char* __c = static_cast<char*>(__v) + sizeof(_Block_address);
- __block = reinterpret_cast<_Block_record*>(__c);
+ __block_record = reinterpret_cast<_Block_record*>(__c);
__bin._M_free[__thread_id] = __block_count;
- __bin._M_first[__thread_id] = __block;
+ __bin._M_first[__thread_id] = __block_record;
while (--__block_count > 0)
{
__c += __bin_size;
- __block->_M_next = reinterpret_cast<_Block_record*>(__c);
- __block = __block->_M_next;
+ __block_record->_M_next = reinterpret_cast<_Block_record*>(__c);
+ __block_record = __block_record->_M_next;
}
- __block->_M_next = NULL;
+ __block_record->_M_next = NULL;
}
else
{
@@ -405,11 +405,11 @@
{
__bin._M_free[__thread_id] = __block_count;
__bin._M_free[0] -= __block_count;
- __block = __bin._M_first[0];
+ __block_record = __bin._M_first[0];
while (--__block_count > 0)
- __block = __block->_M_next;
- __bin._M_first[0] = __block->_M_next;
- __block->_M_next = NULL;
+ __block_record = __block_record->_M_next;
+ __bin._M_first[0] = __block_record->_M_next;
+ __block_record->_M_next = NULL;
}
__gthread_mutex_unlock(__bin._M_mutex);
}
@@ -423,23 +423,23 @@
__bin._M_address = __address;
char* __c = static_cast<char*>(__v) + sizeof(_Block_address);
- __block = reinterpret_cast<_Block_record*>(__c);
- __bin._M_first[0] = __block;
+ __block_record = reinterpret_cast<_Block_record*>(__c);
+ __bin._M_first[0] = __block_record;
while (--__block_count > 0)
{
__c += __bin_size;
- __block->_M_next = reinterpret_cast<_Block_record*>(__c);
- __block = __block->_M_next;
+ __block_record->_M_next = reinterpret_cast<_Block_record*>(__c);
+ __block_record = __block_record->_M_next;
}
- __block->_M_next = NULL;
+ __block_record->_M_next = NULL;
}
- __block = __bin._M_first[__thread_id];
- __bin._M_first[__thread_id] = __block->_M_next;
+ __block_record = __bin._M_first[__thread_id];
+ __bin._M_first[__thread_id] = __block_record->_M_next;
if (__gthread_active_p())
{
- __block->_M_thread_id = __thread_id;
+ __block_record->_M_thread_id = __thread_id;
--__bin._M_free[__thread_id];
++__bin._M_used[__thread_id];
}
@@ -446,7 +446,7 @@
// NB: For alignment reasons, we can't use the first _M_align
// bytes, even when sizeof(_Block_record) < _M_align.
- return reinterpret_cast<char*>(__block) + __options._M_align;
+ return reinterpret_cast<char*>(__block_record) + __options._M_align;
}
void
More information about the Midnightbsd-cvs
mailing list