malloc_allocator.h: Add operators ==, !=.

2004-02-20  Benjamin Kosnik  <bkoz@redhat.com>

	* include/ext/malloc_allocator.h: Add operators ==, !=.
	* include/ext/new_allocator.h: Add operators ==, !=.
	* include/ext/mt_allocator.h (__mt_alloc::tune): New.
	(__mt_alloc::_S_get_options): New.
	(__mt_alloc::_S_set_options): New.
	(__mt_alloc::_S_thread_key_destr): To _S_destroy_thread_key.
	(__mt_alloc::_S_no_of_bins): To _S_bin_size.
	Move functions out of line, simplify, format.
	* src/allocator.cc: Simplify explicit instantiations.
	* include/bits/allocator.h: Tweak.

From-SVN: r78314
This commit is contained in:
Benjamin Kosnik 2004-02-23 15:41:43 +00:00 committed by Benjamin Kosnik
parent 2b0c1c5623
commit f263b26e17
6 changed files with 537 additions and 638 deletions

View File

@ -1,3 +1,16 @@
2004-02-20 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/malloc_allocator.h: Add operators ==, !=.
* include/ext/new_allocator.h: Add operators ==, !=.
* include/ext/mt_allocator.h (__mt_alloc::tune): New.
(__mt_alloc::_S_get_options): New.
(__mt_alloc::_S_set_options): New.
(__mt_alloc::_S_thread_key_destr): To _S_destroy_thread_key.
(__mt_alloc::_S_no_of_bins): To _S_bin_size.
Move functions out of line, simplify, format.
* src/allocator.cc: Simplify explicit instantiations.
* include/bits/allocator.h: Tweak.
2004-02-22 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (money_put<>::_M_insert):

View File

@ -48,15 +48,13 @@
#ifndef _ALLOCATOR_H
#define _ALLOCATOR_H 1
#if 1
# include <ext/new_allocator.h>
# define __glibcxx_default_allocator __gnu_cxx::new_allocator
#endif
// Define the base class to std::allocator.
#if 0
# include <ext/pool_allocator.h>
# define __glibcxx_default_allocator __gnu_cxx::__pool_alloc
#endif
#include <ext/new_allocator.h>
#define __glibcxx_default_allocator __gnu_cxx::new_allocator
//#include <ext/mt_allocator.h>
//#define __glibcxx_default_allocator __gnu_cxx::__mt_alloc
namespace std
{

View File

@ -98,6 +98,16 @@ namespace __gnu_cxx
void
destroy(pointer __p) { __p->~_Tp(); }
};
template<typename _Tp>
inline bool
operator==(const malloc_allocator<_Tp>&, const malloc_allocator<_Tp>&)
{ return true; }
template<typename _Tp>
inline bool
operator!=(const malloc_allocator<_Tp>&, const malloc_allocator<_Tp>&)
{ return false; }
} // namespace __gnu_cxx
#endif

File diff suppressed because it is too large Load Diff

View File

@ -98,6 +98,16 @@ namespace __gnu_cxx
void
destroy(pointer __p) { __p->~_Tp(); }
};
template<typename _Tp>
inline bool
operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
{ return true; }
template<typename _Tp>
inline bool
operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
{ return false; }
} // namespace __gnu_cxx
#endif

View File

@ -40,19 +40,7 @@
// allocator.
namespace __gnu_cxx
{
// Static data members and member functions of __mt_alloc.
static template class __mt_alloc<char>;
template
void __mt_alloc<char>::_S_init();
#ifdef __GTHREADS
template
size_t __mt_alloc<char>::_S_get_thread_id();
template
void __mt_alloc<char>::_S_thread_key_destr(void*);
#endif
template class __mt_alloc<char>;
// Static members of __pool_alloc.
template class __pool_alloc<true, 0>;