stl_algobase.h: Do not include <cstring>.
2007-05-07 Paolo Carlini <pcarlini@suse.de> * include/bits/stl_algobase.h: Do not include <cstring>. (copy(const _Tp*, const _Tp*, _Tp*), __copy_b(const _Tp*, const _Tp*, _Tp*)): Use __builtin_memmove. (__fill_aux): Use __builtin_memset. (equal(const _Tp*, const _Tp*, const _Tp*), lexicographical_compare(const unsigned char*, const unsigned char*, const unsigned char*, const unsigned char*)): Use __builtin_memcmp. * include/bits/valarray_array.h: Do not include <cstring>. (_Array_default_ctor<, true>::_S_do_it): Use __builtin_memset. (_Array_copy_ctor<, true>::_S_do_it, _Array_copier<, true>::_S_do_it): Use __builtin_memcpy. * include/ext/algorithm (__lexicographical_compare_3way(const unsigned char*, const unsigned char*, const unsigned char*, const unsigned char*)): Use __builtin_memcmp. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Adjust dg-error line number. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. From-SVN: r124512
This commit is contained in:
parent
360721e336
commit
6ca20f85cf
@ -1,7 +1,8 @@
|
|||||||
// The template and inlines for the -*- C++ -*- internal _Array helper class.
|
// The template and inlines for the -*- C++ -*- internal _Array helper class.
|
||||||
|
|
||||||
// Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2007
|
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||||
// Free Software Foundation, Inc.
|
// 2006, 2007
|
||||||
|
// Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
// software; you can redistribute it and/or modify it under the
|
// software; you can redistribute it and/or modify it under the
|
||||||
@ -43,7 +44,6 @@
|
|||||||
#include <bits/c++config.h>
|
#include <bits/c++config.h>
|
||||||
#include <bits/cpp_type_traits.h>
|
#include <bits/cpp_type_traits.h>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
_GLIBCXX_BEGIN_NAMESPACE(std)
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
@ -91,7 +91,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||||||
// For fundamental types, it suffices to say 'memset()'
|
// For fundamental types, it suffices to say 'memset()'
|
||||||
inline static void
|
inline static void
|
||||||
_S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
|
_S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
|
||||||
{ std::memset(__b, 0, (__e - __b) * sizeof(_Tp)); }
|
{ __builtin_memset(__b, 0, (__e - __b) * sizeof(_Tp)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
@ -160,7 +160,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||||||
inline static void
|
inline static void
|
||||||
_S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e,
|
_S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e,
|
||||||
_Tp* __restrict__ __o)
|
_Tp* __restrict__ __o)
|
||||||
{ std::memcpy(__o, __b, (__e - __b)*sizeof(_Tp)); }
|
{ __builtin_memcpy(__o, __b, (__e - __b) * sizeof(_Tp)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
@ -267,7 +267,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||||||
{
|
{
|
||||||
inline static void
|
inline static void
|
||||||
_S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
|
_S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
|
||||||
{ std::memcpy (__b, __a, __n * sizeof (_Tp)); }
|
{ __builtin_memcpy(__b, __a, __n * sizeof (_Tp)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Copy a plain array __a[<__n>] into a play array __b[<>]
|
// Copy a plain array __a[<__n>] into a play array __b[<>]
|
||||||
|
Loading…
Reference in New Issue
Block a user