dbertoni    01/03/02 11:07:43

  Modified:    c/src/PlatformSupport ArenaAllocator.hpp
                        ReusableArenaAllocator.hpp
  Log:
  Moved part of function into base class.
  
  Revision  Changes    Path
  1.10      +30 -0     xml-xalan/c/src/PlatformSupport/ArenaAllocator.hpp
  
  Index: ArenaAllocator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/ArenaAllocator.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ArenaAllocator.hpp        2001/01/19 18:52:20     1.9
  +++ ArenaAllocator.hpp        2001/03/02 19:07:27     1.10
  @@ -187,6 +187,36 @@
                assert(m_blocks.back()->ownsObject(theObject) == true);
        }
   
  +     virtual bool
  +     ownsObject(const ObjectType*    theObject) const
  +     {
  +             bool    fResult = false;
  +
  +             // Search back for a block that may have allocated the object...
  +             // Note that this-> is required by template lookup rules.
  +             const typename ArenaBlockListType::const_reverse_iterator       
theEnd = this->m_blocks.rend();
  +
  +             typename ArenaBlockListType::const_reverse_iterator     i = 
this->m_blocks.rbegin();
  +
  +             while(i != theEnd)
  +             {
  +                     assert(*i != 0);
  +
  +                     if ((*i)->ownsObject(theObject) == true)
  +                     {
  +                             fResult = true;
  +
  +                             break;
  +                     }
  +                     else
  +                     {
  +                             ++i;
  +                     }
  +             }
  +
  +             return fResult;
  +     }
  +
        virtual void
        reset()
        {
  
  
  
  1.12      +1 -21     
xml-xalan/c/src/PlatformSupport/ReusableArenaAllocator.hpp
  
  Index: ReusableArenaAllocator.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/PlatformSupport/ReusableArenaAllocator.hpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ReusableArenaAllocator.hpp        2000/11/30 19:26:19     1.11
  +++ ReusableArenaAllocator.hpp        2001/03/02 19:07:33     1.12
  @@ -244,27 +244,7 @@
   
                        if (fResult == false)
                        {
  -                             // Search back for a block with some space 
available...
  -                             // Note that this-> is required by template 
lookup rules.
  -                             const typename 
ArenaBlockListType::const_reverse_iterator       theEnd = this->m_blocks.rend();
  -
  -                             typename 
ArenaBlockListType::const_reverse_iterator     i = this->m_blocks.rbegin();
  -
  -                             while(i != theEnd)
  -                             {
  -                                     assert(*i != 0);
  -
  -                                     if ((*i)->ownsObject(theObject) == true)
  -                                     {
  -                                             fResult = true;
  -
  -                                             break;
  -                                     }
  -                                     else
  -                                     {
  -                                             ++i;
  -                                     }
  -                             }
  +                             fResult = BaseClassType::ownsObject(theObject);
                        }
                }
   
  
  
  

Reply via email to