Skip to content
Snippets Groups Projects
Commit cc748e91 authored by Markus Blatt's avatar Markus Blatt
Browse files

Reverting patch 5670.

Inheritence breaks the rebind TMP of the allocator as it returns std::alloc now which cannot be converted to PoolAllocator.


[[Imported from SVN: r5671]]
parent f89cf4f5
No related merge requests found
......@@ -233,9 +233,6 @@ namespace Dune
* This means that assuming that N objects fit into memory only every N-th
* request for an object will result in memory allocation.
*
* @warning This class currently falls back to std::allocator as the current
* implementation has serious and hard to find bugs.
*
* @warning It is not suitable
* for the use in standard containers as it cannot allocate
* arrays of arbitrary size
......@@ -245,10 +242,6 @@ namespace Dune
*/
template<class T, std::size_t s>
class PoolAllocator
#ifndef USE_DUNE_POOL
: public std::allocator<T>
{};
#else
{
//friend std::ostream& std::operator<<<>(std::ostream&,PoolAllocator<T,s>&);
......@@ -343,24 +336,18 @@ namespace Dune
/**
* @brief Convert a reference to a pointer.
*/
inline pointer address(reference x) const {
return &x;
}
inline pointer address(reference x) const { return &x; }
/**
* @brief Convert a reference to a pointer.
*/
inline const_pointer address(const_reference x) const {
return &x;
}
inline const_pointer address(const_reference x) const { return &x; }
/**
* @brief Not correctly implemented, yet!
*/
inline int max_size() const throw(){
return 1;
}
inline int max_size() const throw(){ return 1;}
/**
* @brief Rebind the allocator to another type.
......@@ -465,7 +452,6 @@ namespace Dune
{
return false;
}
#endif
template<class T, std::size_t S>
inline Pool<T,S>::Pool()
......@@ -557,8 +543,6 @@ namespace Dune
return reinterpret_cast<T*>(p);
}
#ifdef USE_DUNE_POOL
template<class T, std::size_t s>
typename PoolAllocator<T,s>::PoolType PoolAllocator<T,s>::memoryPool_;
......@@ -591,7 +575,7 @@ namespace Dune
{
p->~T();
}
#endif
/** @} */
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment