15460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao//===- GCFactory.h --------------------------------------------------------===//
25460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao//
35460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao//                     The MCLinker Project
45460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao//
55460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao// This file is distributed under the University of Illinois Open Source
65460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao// License. See LICENSE.TXT for details.
75460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao//
85460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao//===----------------------------------------------------------------------===//
95460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao#ifndef MCLD_GC_FACTORY_H
105460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao#define MCLD_GC_FACTORY_H
115460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao#ifdef ENABLE_UNITTEST
125460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao#include <gtest.h>
135460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao#endif
145460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao#include "mcld/ADT/TypeTraits.h"
155460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao#include "mcld/Support/Allocators.h"
165460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
175460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao#include <assert.h>
18f767be5432ccac097334be48698e48621d730190Shih-wei Liao#include <cstddef>
195460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao#include <iterator>
205460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
215460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaonamespace mcld
225460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao{
235460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
245460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao/** \class DataIteratorBase
255460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao *  \brief DataIteratorBase provides the basic functions of DataIterator
265460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao *  @see DataIterator
275460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao */
285460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaotemplate<typename ChunkType>
295460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaostruct DataIteratorBase
305460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao{
315460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaopublic:
325460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  ChunkType* m_pChunk;
335460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  unsigned int m_Pos;
345460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
355460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaopublic:
365460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  DataIteratorBase(ChunkType* X, unsigned int pPos)
375460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  : m_pChunk(X), m_Pos(pPos)
385460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { }
395460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
405460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  inline void advance() {
415460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    ++m_Pos;
425460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    if ((m_Pos == m_pChunk->bound) && (0 == m_pChunk->next))
435460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao      return;
445460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    if (m_Pos == m_pChunk->bound) {
455460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao      m_pChunk = m_pChunk->next;
465460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao      m_Pos = 0;
475460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    }
485460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  }
495460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
505460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  bool operator==(const DataIteratorBase& y) const
515460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { return ((this->m_pChunk == y.m_pChunk) && (this->m_Pos == y.m_Pos)); }
525460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
535460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  bool operator!=(const DataIteratorBase& y) const
545460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { return ((this->m_pChunk != y.m_pChunk) || (this->m_Pos != y.m_Pos)); }
555460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao};
565460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
575460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao/** \class DataIterator
585460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao *  \brief DataIterator provides STL compatible iterator for allocators
595460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao */
605460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaotemplate<typename ChunkType, class Traits>
615460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaoclass DataIterator : public DataIteratorBase<ChunkType>
625460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao{
635460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaopublic:
645460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef typename ChunkType::value_type  value_type;
655460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef Traits                          traits;
665460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef typename traits::pointer        pointer;
675460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef typename traits::reference      reference;
685460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef DataIterator<ChunkType, Traits> Self;
695460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef DataIteratorBase<ChunkType>     Base;
705460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
715460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef typename traits::nonconst_traits         nonconst_traits;
725460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef DataIterator<ChunkType, nonconst_traits> iterator;
735460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef typename traits::const_traits            const_traits;
745460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef DataIterator<ChunkType, const_traits>    const_iterator;
755460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef std::forward_iterator_tag                iterator_category;
765460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef size_t                                   size_type;
775460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef ptrdiff_t                                difference_type;
785460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
795460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaopublic:
805460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  DataIterator()
815460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  : Base(0, 0)
825460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { }
835460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
845460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  DataIterator(ChunkType* pChunk, unsigned int pPos)
855460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  : Base(pChunk, pPos)
865460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { }
875460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
885460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  DataIterator(const DataIterator& pCopy)
895460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  : Base(pCopy.m_pChunk, pCopy.m_Pos)
905460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { }
915460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
925460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  ~DataIterator()
935460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { }
945460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
955460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  // -----  operators  ----- //
965460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  reference operator*() {
975460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    if (0 == this->m_pChunk)
985460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao      assert(0 && "data iterator goes to a invalid position");
995460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    return this->m_pChunk->data[Base::m_Pos];
1005460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  }
1015460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1025460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  Self& operator++() {
1035460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    this->Base::advance();
1045460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    return *this;
1055460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  }
1065460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1075460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  Self operator++(int) {
1085460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    Self tmp = *this;
1095460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    this->Base::advance();
1105460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    return tmp;
1115460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  }
1125460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao};
1135460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1145460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaotemplate<typename Alloc>
1155460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaoclass GCFactoryBase : public Alloc
1165460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao{
1175460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaopublic:
1185460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef DataIterator<typename Alloc::chunk_type,
1195460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao                       NonConstTraits<
1205460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao                         typename Alloc::value_type> > iterator;
1215460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef DataIterator<typename Alloc::chunk_type,
1225460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao                       ConstTraits<
1235460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao                         typename Alloc::value_type> > const_iterator;
1245460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1255460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef typename Alloc::value_type value_type;
1265460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef typename Alloc::pointer    pointer;
1275460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef typename Alloc::reference  reference;
1285460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  typedef typename Alloc::size_type  size_type;
1295460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1305460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaoprotected:
1315460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  GCFactoryBase()
1325460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  : Alloc(), m_NumAllocData(0)
1335460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { }
1345460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1355460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  GCFactoryBase(size_t pNum)
1365460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  : Alloc(pNum), m_NumAllocData(0)
1375460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { }
1385460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1395460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaopublic:
1405460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  virtual ~GCFactoryBase()
1415460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { Alloc::clear(); }
1425460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1435460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  // -----  modifiers  ----- //
1445460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  value_type* allocate(size_t N) {
1455460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    value_type* result = Alloc::allocate(N);
1465460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    if (0 != result)
1475460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao      m_NumAllocData += N;
1485460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    return result;
1495460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  }
1505460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1515460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  value_type* allocate() {
1525460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    ++m_NumAllocData;
1535460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    return Alloc::allocate();
1545460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  }
1555460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1565460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  void deallocate(pointer &pPtr, size_type N) {
1575460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    Alloc::deallocate(pPtr, N);
1585460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    if (0 == pPtr)
1595460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao      m_NumAllocData -= N;
1605460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  }
1615460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1625460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  void deallocate(pointer &pPtr) {
1635460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    Alloc::deallocate(pPtr);
1645460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    if (0 == pPtr)
1655460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao      --m_NumAllocData;
1665460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  }
1675460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1685460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  void reset() {
1695460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    Alloc::reset();
1705460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao    m_NumAllocData = 0;
1715460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  }
1725460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1735460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  // -----  iterators  ----- //
1745460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  iterator begin()
1755460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { return iterator(Alloc::m_pRoot, 0); }
1765460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1775460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  const_iterator begin() const
1785460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { return const_iterator(Alloc::m_pRoot, 0); }
1795460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1805460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  iterator end() {
181f767be5432ccac097334be48698e48621d730190Shih-wei Liao    return (0 == Alloc::m_pCurrent)?
1825460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao             begin():
1835460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao             iterator(Alloc::m_pCurrent, Alloc::m_pCurrent->bound);
1845460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  }
1855460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1865460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  const_iterator end() const {
187f767be5432ccac097334be48698e48621d730190Shih-wei Liao    return (0 == Alloc::m_pCurrent)?
1885460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao             begin():
1895460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao             const_iterator(Alloc::m_pCurrent, Alloc::m_pCurrent->bound);
1905460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  }
1915460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1925460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  // -----  observers  ----- //
1935460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  bool empty() const
1945460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { return Alloc::empty(); }
1955460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1965460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  unsigned int capacity() const
1975460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { return Alloc::max_size(); }
1985460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
1995460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  unsigned int size() const
2005460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { return m_NumAllocData; }
2015460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
2025460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaoprotected:
2035460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  unsigned int m_NumAllocData;
2045460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao};
2055460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
2065460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao/** \class GCFactory
2075460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao *  \brief GCFactory provides a factory that guaratees to remove all allocated
2085460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao *  data.
2095460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao */
2105460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaotemplate<typename DataType, size_t ChunkSize>
2115460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaoclass GCFactory : public GCFactoryBase<LinearAllocator<DataType, ChunkSize> >
2125460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao{
2135460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaopublic:
2145460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  GCFactory()
2155460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  : GCFactoryBase<LinearAllocator<DataType, ChunkSize> >()
2165460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { }
2175460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao};
2185460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
2195460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaotemplate<typename DataType>
2205460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaoclass GCFactory<DataType, 0> : public GCFactoryBase<LinearAllocator<DataType, 0> >
2215460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao{
2225460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liaopublic:
2235460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  GCFactory(size_t pNum)
2245460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  : GCFactoryBase<LinearAllocator<DataType, 0> >(pNum)
2255460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao  { }
2265460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao};
2275460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
2285460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao} // namespace of mcld
2295460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao
2305460a1f25d9ddecb5c70667267d66d51af177a99Shih-wei Liao#endif
231affc150dc44fab1911775a49636d0ce85333b634Zonr Chang
232