#ifndef nsCppSharedAllocator_h__
#define nsCppSharedAllocator_h__
#include "nsMemory.h" // for |nsMemory|
#include "nscore.h" // for |NS_XXX_CAST|
#include NEW_H // to allow placement |new|
// under Metrowerks (Mac), we don't have autoconf yet
#ifdef __MWERKS__
#define HAVE_CPP_MEMBER_TEMPLATES
#define HAVE_CPP_NUMERIC_LIMITS
#endif
// under MSVC shut off copious warnings about unused in-lines
#ifdef _MSC_VER
#endif
#ifdef HAVE_CPP_NUMERIC_LIMITS
#include <limits>
#else
#include <limits.h>
#endif
/*
...allows Standard Library containers, et al, to use our global shared
(XP)COM-aware allocator.
*/
{
typedef T value_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
nsCppSharedAllocator() { }
#ifdef HAVE_CPP_MEMBER_TEMPLATES
#endif
~nsCppSharedAllocator() { }
{
return &r;
}
{
return &r;
}
{
}
void
{
}
void
{
}
void
{
p->~T();
}
max_size() const
{
#ifdef HAVE_CPP_NUMERIC_LIMITS
#else
return ULONG_MAX / sizeof(T);
#endif
}
#ifdef HAVE_CPP_MEMBER_TEMPLATES
struct rebind
{
};
#endif
};
{
return PR_TRUE;
}
{
return PR_FALSE;
}
#endif /* !defined(nsCppSharedAllocator_h__) */