Some missing from merge.

Signed-off-by: Salja <salja2012@hotmail.de>
This commit is contained in:
Salja 2012-08-05 14:54:07 +02:00 committed by Antz
parent ec939a5bce
commit f4be15a7af
1895 changed files with 160408 additions and 53601 deletions

View file

@ -4,6 +4,8 @@
/**
* @file Malloc_Base.h
*
* $Id: Malloc_Base.h 92085 2010-09-29 12:23:13Z johnnyw $
*
* @author Doug Schmidt and Irfan Pyarali
*/
//=============================================================================
@ -22,8 +24,6 @@
#include "ace/os_include/sys/os_types.h"
#include "ace/os_include/sys/os_mman.h"
#include "ace/os_include/sys/os_types.h"
#include <limits>
#include <new>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@ -162,71 +162,6 @@ private:
static int delete_allocator_;
};
/**
* @class ACE_Allocator_Std_Adapter
*
* @brief Model of std::allocator that forwards requests to
# ACE_Allocator::instance. To be used with STL containers.
*/
template <typename T>
class ACE_Export ACE_Allocator_Std_Adapter
{
public:
typedef T value_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
template <typename U> struct rebind { typedef ACE_Allocator_Std_Adapter<U> other; };
ACE_Allocator_Std_Adapter() {}
template <typename U>
ACE_Allocator_Std_Adapter(const ACE_Allocator_Std_Adapter<U>&) {}
static T* allocate(std::size_t n)
{
void* raw_mem = ACE_Allocator::instance()->malloc(n * sizeof(T));
if (!raw_mem) throw std::bad_alloc();
return static_cast<T*>(raw_mem);
}
static void deallocate(T* ptr, std::size_t)
{
ACE_Allocator::instance()->free(ptr);
}
static void construct(T* ptr, const T& value)
{
new (static_cast<void*>(ptr)) T(value);
}
static void destroy(T* ptr)
{
ptr->~T();
}
static size_type max_size()
{
return (std::numeric_limits<size_type>::max)();
}
};
template <typename T, typename U>
bool operator==(const ACE_Allocator_Std_Adapter<T>&, const ACE_Allocator_Std_Adapter<U>&)
{
return true;
}
template <typename T, typename U>
bool operator!=(const ACE_Allocator_Std_Adapter<T>&, const ACE_Allocator_Std_Adapter<U>&)
{
return false;
}
ACE_END_VERSIONED_NAMESPACE_DECL
#include /**/ "ace/post.h"