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...@apache.org on 2001/05/10 19:57:18 UTC

cvs commit: xml-xalan/c/src/XPath XPathExecutionContextDefault.cpp XPathExecutionContextDefault.hpp

dbertoni    01/05/10 10:57:18

  Modified:    c/src/XPath XPathExecutionContextDefault.cpp
                        XPathExecutionContextDefault.hpp
  Log:
  Changes for new XalanObjectCache implementation.
  
  Revision  Changes    Path
  1.36      +5 -14     xml-xalan/c/src/XPath/XPathExecutionContextDefault.cpp
  
  Index: XPathExecutionContextDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExecutionContextDefault.cpp,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- XPathExecutionContextDefault.cpp	2001/04/30 18:11:02	1.35
  +++ XPathExecutionContextDefault.cpp	2001/05/10 17:57:12	1.36
  @@ -98,8 +98,8 @@
   	m_contextNodeList(theContextNodeList == 0 ? &s_dummyList : theContextNodeList),
   	m_prefixResolver(thePrefixResolver),
   	m_throwFoundIndex(false),
  -	m_nodeListCache(),
  -	m_resultTreeFragCache(),
  +	m_nodeListCache(eNodeListCacheListSize),
  +	m_resultTreeFragCache(eResultTreeFragCacheListSize),
   	m_stringCache()
   {
   }
  @@ -118,8 +118,8 @@
   	m_contextNodeList(theContextNodeList == 0 ? &s_dummyList : theContextNodeList),
   	m_prefixResolver(thePrefixResolver),
   	m_throwFoundIndex(false),
  -	m_nodeListCache(),
  -	m_resultTreeFragCache(),
  +	m_nodeListCache(eNodeListCacheListSize),
  +	m_resultTreeFragCache(eResultTreeFragCacheListSize),
   	m_stringCache()
   {
   }
  @@ -323,16 +323,7 @@
   bool
   XPathExecutionContextDefault::returnMutableNodeRefList(MutableNodeRefList*	theList)
   {
  -	if (m_nodeListCache.release(theList) == false)
  -	{
  -		return false;
  -	}
  -	else
  -	{
  -		theList->clear();
  -
  -		return true;
  -	}
  +	return m_nodeListCache.release(theList);
   }
   
   
  
  
  
  1.34      +6 -13     xml-xalan/c/src/XPath/XPathExecutionContextDefault.hpp
  
  Index: XPathExecutionContextDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExecutionContextDefault.hpp,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- XPathExecutionContextDefault.hpp	2001/04/30 18:11:02	1.33
  +++ XPathExecutionContextDefault.hpp	2001/05/10 17:57:13	1.34
  @@ -347,18 +347,11 @@
   
   protected:
   
  -	class XalanResultTreeFragCache : public XalanObjectCache<ResultTreeFragBase>
  -	{
  -	protected:
  -
  -		virtual ResultTreeFragBase*
  -		create()
  -		{
  -			return new ResultTreeFrag;
  -		}
  -	};
  +	typedef XalanObjectCache<MutableNodeRefList, DefaultCacheCreateFunctor<MutableNodeRefList>, DeleteFunctor<MutableNodeRefList>, ClearCacheResetFunctor<MutableNodeRefList> >	NodeListCacheType;
  +	typedef XalanObjectCache<ResultTreeFragBase, DefaultCacheCreateFunctor<ResultTreeFrag>, DeleteFunctor<ResultTreeFragBase>, ClearCacheResetFunctor<ResultTreeFragBase> >		ResultTreeFragCacheType;
   
  -	enum { eCachedArgVectorDefaultSize = 10 };
  +	enum { eNodeListCacheListSize = 50,
  + 		   eResultTreeFragCacheListSize = 50 };
   
   	XPathEnvSupport*			m_xpathEnvSupport;
   
  @@ -376,9 +369,9 @@
   
   	XalanDOMString				m_currentPattern;
   
  -	XalanObjectCacheDefault<MutableNodeRefList>		m_nodeListCache;
  +	NodeListCacheType			m_nodeListCache;
   
  -	XalanResultTreeFragCache	m_resultTreeFragCache;
  +	ResultTreeFragCacheType		m_resultTreeFragCache;
   
   	XalanDOMStringCache			m_stringCache;
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org