You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@locus.apache.org on 2000/07/05 19:25:30 UTC

cvs commit: xml-xalan/c/src/PlatformSupport ArenaBlock.hpp ReusableArenaAllocator.hpp

dbertoni    00/07/05 10:25:26

  Modified:    c/src/PlatformSupport ArenaBlock.hpp
                        ReusableArenaAllocator.hpp
  Log:
  Fixed bug in destroyObject().
  
  Revision  Changes    Path
  1.2       +2 -2      xml-xalan/c/src/PlatformSupport/ArenaBlock.hpp
  
  Index: ArenaBlock.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/ArenaBlock.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ArenaBlock.hpp	2000/05/24 19:28:00	1.1
  +++ ArenaBlock.hpp	2000/07/05 17:25:22	1.2
  @@ -173,8 +173,6 @@
   		return m_blockCount;
   	}
   
  -protected:
  -
   	bool
   	ownsObject(const ObjectType*	theObject) const
   	{
  @@ -196,6 +194,8 @@
   			return false;
   		}
   	}
  +
  +protected:
   
   	DestroyFunctionType		m_destroyFunction;
   
  
  
  
  1.2       +17 -1     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReusableArenaAllocator.hpp	2000/05/24 19:28:00	1.1
  +++ ReusableArenaAllocator.hpp	2000/07/05 17:25:23	1.2
  @@ -111,7 +111,23 @@
   	{
   		assert(m_blocks.size() != 0);
   
  -		m_blocks.back()->destroyObject(theObject);
  +		const ArenaBlockListType::iterator	theEnd = m_blocks.end();
  +
  +		ArenaBlockListType::iterator	i = m_blocks.begin();
  +
  +		while(i != theEnd)
  +		{
  +			if (i->ownsObject(theObject) == true)
  +			{
  +				i->destroyObject(theObject);
  +
  +				break;
  +			}
  +			else
  +			{
  +				++i;
  +			}
  +		}
   	}
   };