19720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/*
29720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
39720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 1996,1997
49720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Silicon Graphics Computer Systems, Inc.
59720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
69720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 1997
79720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Moscow Center for SPARC Technology
89720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
99720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 1999
109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Boris Fomitchev
119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * This material is provided "as is", with absolutely no warranty expressed
139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * or implied. Any use is at your own risk.
149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Permission to use or copy this software for any purpose is hereby granted
169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * without fee, provided the above notices are retained on all copies.
179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Permission to modify the code and to distribute modified code is granted,
189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * provided the above notices are retained, and a notice that the code was
199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * modified is included with the above copyright notice.
209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block */
229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/* NOTE: This is an internal header file, included by other STL headers.
249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *   You should not attempt to use it directly.
259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block */
269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_INTERNAL_ALLOC_H
289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#define _STLP_INTERNAL_ALLOC_H
299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_INTERNAL_CSTDDEF
319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  include <stl/_cstddef.h>
329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_INTERNAL_CSTDLIB
359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  include <stl/_cstdlib.h>
369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_INTERNAL_CSTRING
399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  include <stl/_cstring.h>
409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_INTERNAL_ALGOBASE_H
439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  include <stl/_algobase.h>
449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_INTERNAL_NEW_HEADER
479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  include <stl/_new.h>
489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_INTERNAL_CONSTRUCT_H
519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  include <stl/_construct.h>
529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_BEGIN_NAMESPACE
559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// Malloc-based allocator.  Typically slower than default alloc below.
579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// Typically thread-safe and more storage efficient.
589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined (_STLP_USE_NO_IOSTREAMS)
609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktypedef void (* __oom_handler_type)();
619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass _STLP_CLASS_DECLSPEC __malloc_alloc {
649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // this one is needed for proper simple_alloc wrapping
669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef char value_type;
67e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  static void* _STLP_CALL allocate(size_t __n)
689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined (_STLP_USE_NO_IOSTREAMS)
699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  ;
709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  {
729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    void *__result = malloc(__n);
739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    if (__result == 0) {
74e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott      _STLP_THROW_BAD_ALLOC;
759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    }
769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    return __result;
779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static void _STLP_CALL deallocate(void* __p, size_t /* __n */) { free((char*)__p); }
819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined (_STLP_USE_NO_IOSTREAMS)
829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static __oom_handler_type _STLP_CALL set_malloc_handler(__oom_handler_type __f);
839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// New-based allocator.  Typically slower than default alloc below.
879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// Typically thread-safe and more storage efficient.
889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass _STLP_CLASS_DECLSPEC __new_alloc {
899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // this one is needed for proper simple_alloc wrapping
919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef char value_type;
929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static void* _STLP_CALL allocate(size_t __n) { return __stl_new(__n); }
939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static void _STLP_CALL deallocate(void* __p, size_t) { __stl_delete(__p); }
949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// Allocator adaptor to check size arguments for debugging.
979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// Reports errors using assert.  Checking can be disabled with
989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// NDEBUG, but it's far better to just use the underlying allocator
999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// instead when no checking is desired.
1009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// There is some evidence that this can confuse Purify.
1019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// This adaptor can only be applied to raw allocators
1029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Alloc>
1049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass __debug_alloc : public _Alloc {
1059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
1069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Alloc __allocator_type;
1079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Alloc::value_type value_type;
1089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate:
1099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  struct __alloc_header {
1109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    size_t __magic: 16;
1119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    size_t __type_size:16;
1129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _STLP_UINT32_T _M_size;
1139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }; // that is 8 bytes for sure
1149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // Sunpro CC has bug on enums, so extra_before/after set explicitly
1159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  enum { __pad = 8, __magic = 0xdeba, __deleted_magic = 0xdebd,
1169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block         __shred_byte = _STLP_SHRED_BYTE };
1179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  enum { __extra_before = 16, __extra_after = 8 };
1199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // Size of space used to store size.  Note
1209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // that this must be large enough to preserve
1219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // alignment.
1229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static size_t _STLP_CALL __extra_before_chunk() {
1239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    return (long)__extra_before / sizeof(value_type) +
1249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      (size_t)((long)__extra_before % sizeof(value_type) > 0);
1259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
1269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static size_t _STLP_CALL __extra_after_chunk() {
1279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    return (long)__extra_after / sizeof(value_type) +
1289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      (size_t)((long)__extra_after % sizeof(value_type) > 0);
1299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
1309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
1319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  __debug_alloc() {}
1329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  ~__debug_alloc() {}
1339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static void* _STLP_CALL allocate(size_t);
1349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static void _STLP_CALL deallocate(void *, size_t);
1359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
1369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
137e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#  if defined (__OS400__)
138e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott// dums 02/05/2007: is it really necessary ?
139e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scottenum { _MAX_BYTES = 256 };
1409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  else
141e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scottenum { _MAX_BYTES = 32 * sizeof(void*) };
142e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#  endif
1439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined (_STLP_USE_NO_IOSTREAMS)
1459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// Default node allocator.
1469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// With a reasonable compiler, this should be roughly as fast as the
1479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// original STL class-specific allocators, but with less fragmentation.
1489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass _STLP_CLASS_DECLSPEC __node_alloc {
1499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static void * _STLP_CALL _M_allocate(size_t& __n);
1509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  /* __p may not be 0 */
1519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static void _STLP_CALL _M_deallocate(void *__p, size_t __n);
1529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
1549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // this one is needed for proper simple_alloc wrapping
1559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef char value_type;
1569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  /* __n must be > 0      */
1579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static void* _STLP_CALL allocate(size_t& __n)
1589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return (__n > (size_t)_MAX_BYTES) ? __stl_new(__n) : _M_allocate(__n); }
1599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  /* __p may not be 0 */
1609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static void _STLP_CALL deallocate(void *__p, size_t __n)
1619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { if (__n > (size_t)_MAX_BYTES) __stl_delete(__p); else _M_deallocate(__p, __n); }
1629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
1639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
164e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#  if defined (_STLP_USE_TEMPLATE_EXPORT)
1659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_EXPORT_TEMPLATE_CLASS __debug_alloc<__node_alloc>;
166e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#  endif
1679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
168e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
1699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_USE_TEMPLATE_EXPORT)
1719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_EXPORT_TEMPLATE_CLASS __debug_alloc<__new_alloc>;
1729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_EXPORT_TEMPLATE_CLASS __debug_alloc<__malloc_alloc>;
1739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
1749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/* macro to convert the allocator for initialization
1769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * not using MEMBER_TEMPLATE_CLASSES as it should work given template constructor  */
1779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_MEMBER_TEMPLATES) || ! defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
1789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/* if _STLP_NO_TEMPLATE_CONVERSIONS is set, the member template constructor is
1799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * not used implicitly to convert allocator parameter, so let us do it explicitly */
1809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if defined (_STLP_MEMBER_TEMPLATE_CLASSES) && defined (_STLP_NO_TEMPLATE_CONVERSIONS)
1819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    define _STLP_CONVERT_ALLOCATOR(__a, _Tp) __stl_alloc_create(__a,(_Tp*)0)
1829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  else
1839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    define _STLP_CONVERT_ALLOCATOR(__a, _Tp) __a
1849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
1859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/* else convert, but only if partial specialization works, since else
1869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Container::allocator_type won't be different */
1879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
1889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  define _STLP_CONVERT_ALLOCATOR(__a, _Tp) __stl_alloc_create(__a,(_Tp*)0)
189e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
1909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// Another allocator adaptor: _Alloc_traits.  This serves two
1929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// purposes.  First, make it possible to write containers that can use
1939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// either SGI-style allocators or standard-conforming allocator.
1949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// The fully general version.
1969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Tp, class _Allocator>
1979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct _Alloc_traits {
1989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Allocator _Orig;
1999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined (_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE)
2009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Allocator::_STLP_TEMPLATE rebind<_Tp> _Rebind_type;
2019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Rebind_type::other  allocator_type;
2029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static allocator_type create_allocator(const _Orig& __a)
2039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return allocator_type(_STLP_CONVERT_ALLOCATOR(__a, _Tp)); }
2049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
2059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // this is not actually true, used only to pass this type through
2069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // to dynamic overload selection in _STLP_alloc_proxy methods
2079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Allocator allocator_type;
208e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
2099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
2109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_USE_PERTHREAD_ALLOC)
2129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_END_NAMESPACE
2149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// include additional header here
2159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  include <stl/_pthread_alloc.h>
2169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_BEGIN_NAMESPACE
2179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
218e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scotttypedef __pthread_alloc __alloc_type;
219e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#elif defined (_STLP_USE_NEWALLOC)
220e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scotttypedef __new_alloc __alloc_type;
221e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#elif defined (_STLP_USE_MALLOC)
222e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scotttypedef __malloc_alloc __alloc_type;
223e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#else
224e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scotttypedef __node_alloc __alloc_type;
225e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
2269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
227e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if defined (_STLP_DEBUG_ALLOC)
228e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scotttypedef __debug_alloc<__alloc_type> __sgi_alloc;
229e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#else
230e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scotttypedef __alloc_type __sgi_alloc;
231e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
2329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
233e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if !defined (_STLP_NO_ANACHRONISMS)
234e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scotttypedef __sgi_alloc __single_client_alloc;
235e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scotttypedef __sgi_alloc __multithreaded_alloc;
236e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
2379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// This implements allocators as specified in the C++ standard.
2399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block//
2409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// Note that standard-conforming allocators use many language features
2419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// that are not yet widely implemented.  In particular, they rely on
2429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// member templates, partial specialization, partial ordering of function
2439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// templates, the typename keyword, and the use of the template keyword
2449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// to refer to a template member of a dependent type.
2459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/*
2479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Tp>
2489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct _AllocatorAux {
2499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Tp*       pointer;
2509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef const _Tp* const_pointer;
2519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Tp&       reference;
2529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef const _Tp& const_reference;
2539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  pointer address(reference __x) const {return &__x;}
2559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_pointer address(const_reference __x) const { return &__x; }
2569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
2579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Tp>
2599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct _AllocatorAux<const _Tp> {
2609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Tp*       pointer;
2619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef const _Tp* const_pointer;
2629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Tp&       reference;
2639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef const _Tp& const_reference;
2649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_pointer address(const_reference __x) const { return &__x; }
2669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
2679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block*/
2689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Tp>
2709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass allocator //: public _AllocatorAux<_Tp>
2719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/* A small helper struct to recognize STLport allocator implementation
2729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * from any user specialization one.
2739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block */
274e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott                : public __stlport_class<allocator<_Tp> >
275e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott{
2769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
2779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Tp        value_type;
2789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Tp*       pointer;
2799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef const _Tp* const_pointer;
2809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Tp&       reference;
2819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef const _Tp& const_reference;
2829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef size_t     size_type;
2839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef ptrdiff_t  difference_type;
2849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_MEMBER_TEMPLATE_CLASSES)
2859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _Tp1> struct rebind {
2869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    typedef allocator<_Tp1> other;
2879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  };
2889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
2899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  allocator() _STLP_NOTHROW {}
2909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_MEMBER_TEMPLATES)
2919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _Tp1> allocator(const allocator<_Tp1>&) _STLP_NOTHROW {}
2929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
2939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  allocator(const allocator<_Tp>&) _STLP_NOTHROW {}
294e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if !defined (_STLP_NO_MOVE_SEMANTIC)
295a721beb6d7372334152406a36e8db016650a9691Tareq A. Siraj  allocator(__move_source<allocator<_Tp> > _STLP_UNUSED(src)) _STLP_NOTHROW {}
296e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
2979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  ~allocator() _STLP_NOTHROW {}
2989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  pointer address(reference __x) const {return &__x;}
2999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_pointer address(const_reference __x) const { return &__x; }
3009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // __n is permitted to be 0.  The C++ standard says nothing about what the return value is when __n == 0.
3019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Tp* allocate(size_type __n, const void* = 0) {
3029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    if (__n > max_size()) {
303e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott      _STLP_THROW_BAD_ALLOC;
3049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    }
3059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    if (__n != 0) {
3069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      size_type __buf_size = __n * sizeof(value_type);
3079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      _Tp* __ret = __REINTERPRET_CAST(_Tp*, __sgi_alloc::allocate(__buf_size));
3089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_DEBUG_UNINITIALIZED) && !defined (_STLP_DEBUG_ALLOC)
309e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott      memset((char*)__ret, _STLP_SHRED_BYTE, __buf_size);
3109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
3119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      return __ret;
3129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    }
313e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott
314e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott    return 0;
3159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
3169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // __p is permitted to be a null pointer, only if n==0.
3179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void deallocate(pointer __p, size_type __n) {
3189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _STLP_ASSERT( (__p == 0) == (__n == 0) )
3199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    if (__p != 0) {
3209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_DEBUG_UNINITIALIZED) && !defined (_STLP_DEBUG_ALLOC)
3219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      memset((char*)__p, _STLP_SHRED_BYTE, __n * sizeof(value_type));
3229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
3239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      __sgi_alloc::deallocate((void*)__p, __n * sizeof(value_type));
3249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    }
3259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
326e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if !defined (_STLP_NO_ANACHRONISMS)
3279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // backwards compatibility
3289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void deallocate(pointer __p) const {  if (__p != 0) __sgi_alloc::deallocate((void*)__p, sizeof(value_type)); }
329e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
3309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type max_size() const _STLP_NOTHROW  { return size_t(-1) / sizeof(value_type); }
3319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void construct(pointer __p, const_reference __val) { _STLP_STD::_Copy_Construct(__p, __val); }
3329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void destroy(pointer __p) { _STLP_STD::_Destroy(__p); }
3339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_NO_EXTENSIONS)
3359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  /* STLport extension giving rounded size of an allocated memory buffer
3369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   * This method do not have to be part of a user defined allocator implementation
3379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   * and won't even be called if such a function was granted.
3389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   */
3399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprotected:
3409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
341e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  _Tp* _M_allocate(size_type __n, size_type& __allocated_n) {
3429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    if (__n > max_size()) {
343e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott      _STLP_THROW_BAD_ALLOC;
3449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    }
3459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    if (__n != 0) {
3479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      size_type __buf_size = __n * sizeof(value_type);
3489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      _Tp* __ret = __REINTERPRET_CAST(_Tp*, __sgi_alloc::allocate(__buf_size));
3499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_DEBUG_UNINITIALIZED) && !defined (_STLP_DEBUG_ALLOC)
350e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott      memset((char*)__ret, _STLP_SHRED_BYTE, __buf_size);
3519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
3529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      __allocated_n = __buf_size / sizeof(value_type);
3539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      return __ret;
3549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    }
355e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott
356e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott    return 0;
3579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
358e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
359e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  void _M_swap_workaround(allocator<_Tp>& __other) {}
360e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
3619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
3629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_TEMPLATE_NULL
3649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass _STLP_CLASS_DECLSPEC allocator<void> {
3659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
3669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef size_t      size_type;
3679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef ptrdiff_t   difference_type;
3689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef void*       pointer;
3699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef const void* const_pointer;
3709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
3719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef void        value_type;
3729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
3739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_MEMBER_TEMPLATE_CLASSES)
3749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _Tp1> struct rebind {
3759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    typedef allocator<_Tp1> other;
3769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  };
3779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
3789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
3799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
380e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scotttemplate <class _T1, class _T2>
381e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scottinline bool _STLP_CALL operator==(const allocator<_T1>&, const allocator<_T2>&) _STLP_NOTHROW
382e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott{ return true; }
383e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scotttemplate <class _T1, class _T2>
384e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scottinline bool _STLP_CALL operator!=(const allocator<_T1>&, const allocator<_T2>&) _STLP_NOTHROW
385e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott{ return false; }
3869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_USE_TEMPLATE_EXPORT)
3889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_EXPORT_TEMPLATE_CLASS allocator<char>;
3899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if defined (_STLP_HAS_WCHAR_T)
3909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_EXPORT_TEMPLATE_CLASS allocator<wchar_t>;
3919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
3929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if defined (_STLP_USE_PTR_SPECIALIZATIONS)
3939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_EXPORT_TEMPLATE_CLASS allocator<void*>;
3949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
3959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
3969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_MOVE_TO_PRIV_NAMESPACE
3989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Tp>
4009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct __alloc_type_traits {
4019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined (__BORLANDC__)
4029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _IsSTLportClass<allocator<_Tp> >::_Ret _STLportAlloc;
4039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
4049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  enum { _Is = _IsSTLportClass<allocator<_Tp> >::_Is };
4059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename __bool2type<_Is>::_Ret _STLportAlloc;
4069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
4079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  //The default allocator implementation which is recognize thanks to the
4089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  //__stlport_class inheritance is a stateless object so:
4099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _STLportAlloc has_trivial_default_constructor;
4109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _STLportAlloc has_trivial_copy_constructor;
4119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _STLportAlloc has_trivial_assignment_operator;
4129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _STLportAlloc has_trivial_destructor;
4139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _STLportAlloc is_POD_type;
4149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
4159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_MOVE_TO_STD_NAMESPACE
4179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
4199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Tp>
4209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct __type_traits<allocator<_Tp> > : _STLP_PRIV __alloc_type_traits<_Tp> {};
4219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
4229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_TEMPLATE_NULL
4239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct __type_traits<allocator<char> > : _STLP_PRIV __alloc_type_traits<char> {};
4249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if defined (_STLP_HAS_WCHAR_T)
4259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_TEMPLATE_NULL
4269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct __type_traits<allocator<wchar_t> > : _STLP_PRIV __alloc_type_traits<wchar_t> {};
4279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
4289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if defined (_STLP_USE_PTR_SPECIALIZATIONS)
4299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_TEMPLATE_NULL
4309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct __type_traits<allocator<void*> > : _STLP_PRIV __alloc_type_traits<void*> {};
4319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
4329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
4339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined (_STLP_FORCE_ALLOCATORS)
4369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  define _STLP_FORCE_ALLOCATORS(a,y)
4379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
4389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && !defined (_STLP_MEMBER_TEMPLATE_CLASSES)
4409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// The version for the default allocator, for rare occasion when we have partial spec w/o member template classes
4419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Tp, class _Tp1>
4429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct _Alloc_traits<_Tp, allocator<_Tp1> > {
4439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef allocator<_Tp1> _Orig;
4449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef allocator<_Tp> allocator_type;
4459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  static allocator_type create_allocator(const allocator<_Tp1 >& __a)
4469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return allocator_type(_STLP_CONVERT_ALLOCATOR(__a, _Tp)); }
4479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
448e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
4499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined (_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE) && defined (_STLP_MEMBER_TEMPLATES)
4519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Tp, class _Alloc>
4529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockinline _STLP_TYPENAME_ON_RETURN_TYPE _Alloc_traits<_Tp, _Alloc>::allocator_type  _STLP_CALL
4539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block__stl_alloc_create(const _Alloc& __a, const _Tp*) {
4549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Alloc::_STLP_TEMPLATE rebind<_Tp>::other _Rebound_type;
4559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  return _Rebound_type(__a);
4569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block}
4579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
4589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// If custom allocators are being used without member template classes support :
4599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// user (on purpose) is forced to define rebind/get operations !!!
4609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Tp1, class _Tp2>
4619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockinline allocator<_Tp2>& _STLP_CALL
4629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block__stl_alloc_rebind(allocator<_Tp1>& __a, const _Tp2*) {  return (allocator<_Tp2>&)(__a); }
4639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Tp1, class _Tp2>
4649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockinline allocator<_Tp2> _STLP_CALL
4659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block__stl_alloc_create(const allocator<_Tp1>&, const _Tp2*) { return allocator<_Tp2>(); }
4669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
4679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_MOVE_TO_PRIV_NAMESPACE
4699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// inheritance is being used for EBO optimization
4719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Value, class _Tp, class _MaybeReboundAlloc>
4729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass _STLP_alloc_proxy : public _MaybeReboundAlloc {
4739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate:
4749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _MaybeReboundAlloc _Base;
4759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Base::size_type size_type;
4769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _STLP_alloc_proxy<_Value, _Tp, _MaybeReboundAlloc> _Self;
4779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
4789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Value _M_data;
4799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_alloc_proxy (const _MaybeReboundAlloc& __a, _Value __p) :
4819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _MaybeReboundAlloc(__a), _M_data(__p) {}
4829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
483e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if !defined (_STLP_NO_MOVE_SEMANTIC)
4849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_alloc_proxy (__move_source<_Self> src) :
485e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott    _Base(_STLP_PRIV _AsMoveSource(src.get()._M_base())),
486e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott    _M_data(_STLP_PRIV _AsMoveSource(src.get()._M_data)) {}
487e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott
488e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  _Base& _M_base()
489e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  { return *this; }
490e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
4919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate:
4939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  /* Following are helper methods to detect stateless allocators and avoid
4949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   * swap in this case. For some compilers (VC6) it is a workaround for a
4959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   * compiler bug in the Empty Base class Optimization feature, for others
4969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   * it is a small optimization or nothing if no EBO. */
4979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void _M_swap_alloc(_Self&, const __true_type& /*_IsStateless*/)
4989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  {}
4999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
5009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void _M_swap_alloc(_Self& __x, const __false_type& /*_IsStateless*/) {
5019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _MaybeReboundAlloc &__base_this = *this;
5029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _MaybeReboundAlloc &__base_x = __x;
5039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _STLP_STD::swap(__base_this, __base_x);
5049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
5059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
5069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
5079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void _M_swap_alloc(_Self& __x) {
5089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined (__BORLANDC__)
5099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    typedef typename _IsStateless<_MaybeReboundAlloc>::_Ret _StatelessAlloc;
5109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
5119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    typedef typename __bool2type<_IsStateless<_MaybeReboundAlloc>::_Is>::_Ret _StatelessAlloc;
5129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
5139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _M_swap_alloc(__x, _StatelessAlloc());
5149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
5159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
5169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  /* We need to define the following swap implementation for allocator with state
5179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   * as those allocators might have implement a special swap function to correctly
5189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   * move datas from an instance to the oher, _STLP_alloc_proxy should not break
5199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   * this mecanism. */
5209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void swap(_Self& __x) {
5219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _M_swap_alloc(__x);
5229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _STLP_STD::swap(_M_data, __x._M_data);
5239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
5249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
5259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Tp* allocate(size_type __n, size_type& __allocated_n) {
5269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined (__BORLANDC__)
5279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    typedef typename _IsSTLportClass<_MaybeReboundAlloc>::_Ret _STLportAlloc;
5289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
5299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    typedef typename __bool2type<_IsSTLportClass<_MaybeReboundAlloc>::_Is>::_Ret _STLportAlloc;
5309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
5319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    return allocate(__n, __allocated_n, _STLportAlloc());
5329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
5339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
5349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // Unified interface to perform allocate()/deallocate() with limited
5359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // language support
5369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE)
5379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  // else it is rebound already, and allocate() member is accessible
5389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Tp* allocate(size_type __n)
5399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return __stl_alloc_rebind(__STATIC_CAST(_Base&, *this), __STATIC_CAST(_Tp*, 0)).allocate(__n, 0); }
5409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void deallocate(_Tp* __p, size_type __n)
5419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { __stl_alloc_rebind(__STATIC_CAST(_Base&, *this), __STATIC_CAST(_Tp*, 0)).deallocate(__p, __n); }
5429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate:
5439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Tp* allocate(size_type __n, size_type& __allocated_n, const __true_type& /*STLport allocator*/)
544e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  { return __stl_alloc_rebind(__STATIC_CAST(_Base&, *this), __STATIC_CAST(_Tp*, 0))._M_allocate(__n, __allocated_n); }
5459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
5469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  //Expose Standard allocate overload (using expression do not work for some compilers (Borland))
5479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Tp* allocate(size_type __n)
5489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return _Base::allocate(__n); }
5499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate:
5509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Tp* allocate(size_type __n, size_type& __allocated_n, const __true_type& /*STLport allocator*/)
551e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  { return _Base::_M_allocate(__n, __allocated_n); }
5529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
5539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
5549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Tp* allocate(size_type __n, size_type& __allocated_n, const __false_type& /*STLport allocator*/)
5559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { __allocated_n = __n; return allocate(__n); }
5569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
5579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
5589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_USE_TEMPLATE_EXPORT)
5599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_EXPORT_TEMPLATE_CLASS _STLP_alloc_proxy<char*, char, allocator<char> >;
5609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if defined (_STLP_HAS_WCHAR_T)
5619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_EXPORT_TEMPLATE_CLASS _STLP_alloc_proxy<wchar_t*, wchar_t, allocator<wchar_t> >;
5629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
5639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if defined (_STLP_USE_PTR_SPECIALIZATIONS)
5649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_EXPORT_TEMPLATE_CLASS _STLP_alloc_proxy<void**, void*, allocator<void*> >;
5659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
5669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
5679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
5689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_MOVE_TO_STD_NAMESPACE
5699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_END_NAMESPACE
5709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
5719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_EXPOSE_GLOBALS_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
5729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  include <stl/_alloc.c>
5739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
5749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
5759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /* _STLP_INTERNAL_ALLOC_H */
5769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
5779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// Local Variables:
5789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// mode:C++
5799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// End:
580e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott
581