Commit 64be2eb634655a0ac1af1c1cf1a8f8a00752125d

Hide __alloc_type into allocator class

allocator::__alloc_type is implementation of allocator,
selection base on #defines. Don't expose it to user.
  
397397};
398398
399399#if defined (_STLP_USE_PERTHREAD_ALLOC)
400
401400_STLP_END_NAMESPACE
402// include additional header here
403401# include <stl/_pthread_alloc.h>
404402_STLP_BEGIN_NAMESPACE
405
406typedef __pthread_alloc __alloc_type;
407#elif defined (_STLP_USE_NEWALLOC)
408typedef __new_alloc __alloc_type;
409#elif defined (_STLP_USE_MALLOC)
410typedef __malloc_alloc __alloc_type;
411#else
412typedef __node_alloc __alloc_type;
413403#endif
414404
415#if defined (_STLP_DEBUG_ALLOC)
416typedef __debug_alloc<__alloc_type> __sgi_alloc;
417#else
418typedef __alloc_type __sgi_alloc;
419#endif
420
421405// This implements allocators as specified in the C++ standard.
422406//
423407// Note that standard-conforming allocators use many language features
413413template <class _Tp>
414414class allocator
415415{
416 private:
417 // underlying allocator implementation
418#if defined (_STLP_USE_PERTHREAD_ALLOC)
419#ifdef _STLP_DEBUG_ALLOC
420 typedef __debug_alloc<__pthread_alloc> __alloc_type;
421#else
422 typedef __pthread_alloc __alloc_type;
423#endif
424
425#elif defined (_STLP_USE_NEWALLOC)
426
427#ifdef _STLP_DEBUG_ALLOC
428 typedef __debug_alloc<__new_alloc> __alloc_type;
429#else
430 typedef __new_alloc __alloc_type;
431#endif
432
433#elif defined (_STLP_USE_MALLOC)
434
435#ifdef _STLP_DEBUG_ALLOC
436 typedef __debug_alloc<__malloc_alloc> __alloc_type;
437#else
438 typedef __malloc_alloc __alloc_type;
439#endif
440
441#else // then use __node_alloc
442
443#ifdef _STLP_DEBUG_ALLOC
444 typedef __debug_alloc<__node_alloc> __alloc_type;
445#else
446 typedef __node_alloc __alloc_type;
447#endif
448
449#endif
450
416451 public:
417452 typedef _Tp value_type;
418453 typedef _Tp* pointer;
488488 }
489489 if (__n != 0) {
490490 size_type __buf_size = __n * sizeof(value_type);
491 _Tp* __ret = __REINTERPRET_CAST(_Tp*, __sgi_alloc::allocate(__buf_size));
491 _Tp* __ret = __REINTERPRET_CAST(_Tp*, __alloc_type::allocate(__buf_size));
492492#if defined (_STLP_DEBUG_UNINITIALIZED) && !defined (_STLP_DEBUG_ALLOC)
493493 memset((char*)__ret, _STLP_SHRED_BYTE, __buf_size);
494494#endif
506506#if defined (_STLP_DEBUG_UNINITIALIZED) && !defined (_STLP_DEBUG_ALLOC)
507507 memset((char*)__p, _STLP_SHRED_BYTE, __n * sizeof(value_type));
508508#endif
509 __sgi_alloc::deallocate((void*)__p, __n * sizeof(value_type));
509 __alloc_type::deallocate((void*)__p, __n * sizeof(value_type));
510510 }
511511 }
512512#if !defined (_STLP_NO_ANACHRONISMS)
514514 void deallocate(pointer __p) const
515515 {
516516 if (__p != 0)
517 __sgi_alloc::deallocate((void*)__p, sizeof(value_type));
517 __alloc_type::deallocate((void*)__p, sizeof(value_type));
518518 }
519519#endif
520520