xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbert...@apache.org
Subject cvs commit: xml-xalan/c/src/XSLT StylesheetConstructionContextDefault.cpp StylesheetConstructionContextDefault.hpp
Date Fri, 01 Nov 2002 01:36:28 GMT
dbertoni    2002/10/31 17:36:28

  Modified:    c/src/XSLT StylesheetConstructionContextDefault.cpp
                        StylesheetConstructionContextDefault.hpp
  Log:
  Cleaned up unused stuff.
  
  Revision  Changes    Path
  1.26      +5 -30     xml-xalan/c/src/XSLT/StylesheetConstructionContextDefault.cpp
  
  Index: StylesheetConstructionContextDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetConstructionContextDefault.cpp,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- StylesheetConstructionContextDefault.cpp	31 Oct 2002 07:15:56 -0000	1.25
  +++ StylesheetConstructionContextDefault.cpp	1 Nov 2002 01:36:28 -0000	1.26
  @@ -100,10 +100,8 @@
   			XalanAVTAllocator::size_type			theAVTAllocatorBlockSize,
   			XalanAVTPartSimpleAllocator::size_type	theAVTPartSimpleAllocatorBlockSize,
   			XalanAVTPartXPathAllocator::size_type	theAVTPartXPathAllocatorBlockSize,
  -			VectorAllocatorSizeType					theAVTPointerVectorAllocatorBlockSize,
  -			VectorAllocatorSizeType					theAVTPartPointerVectorAllocatorBlockSize,
   			XalanQNameByValueAllocator::size_type	theXalanQNameByValueAllocatorBlockSize,
  -			VectorAllocatorSizeType					theXalanQNamePointerVectorAllocatorBlockSize) :
  +			VectorAllocatorSizeType					thePointerVectorAllocatorBlockSize) :
   	StylesheetConstructionContext(),
   	m_processor(processor),
   	m_xpathFactory(xpathFactory),
  @@ -117,12 +115,9 @@
   	m_avtAllocator(theAVTAllocatorBlockSize),
   	m_avtPartSimpleAllocator(theAVTPartSimpleAllocatorBlockSize),
   	m_avtPartXPathAllocator(theAVTPartXPathAllocatorBlockSize),
  -	m_avtPointerVectorAllocator(theAVTPointerVectorAllocatorBlockSize),
  -	m_avtPartPointerVectorAllocator(theAVTPartPointerVectorAllocatorBlockSize),
   	m_xalanQNameByValueAllocator(theXalanQNameByValueAllocatorBlockSize),
  -	m_xalanQNameVectorAllocator(theXalanQNamePointerVectorAllocatorBlockSize),
   	m_useAttributeSetsQName(XSLTEngineImpl::getXSLNameSpaceURL(), Constants::ATTRNAME_USEATTRIBUTESETS),
  -	m_pointerVectorAllocator(512)
  +	m_pointerVectorAllocator(thePointerVectorAllocatorBlockSize)
   {
   }
   
  @@ -760,28 +755,10 @@
   
   
   
  -template<class Type>
  -Type
  -allocate(
  -			StylesheetConstructionContextDefault::XalanVoidPointerVectorAllocatorType&	theAllocator,
  -			StylesheetConstructionContextDefault::size_type								theSize,
  -			Type																		theDummy)
  -{
  -#if defined(XALAN_OLD_STYLE_CASTS)
  -	return (Type)theAllocator.allocate(theSize);
  -#else
  -	return reinterpret_cast<Type>(theAllocator.allocate(theSize));
  -#endif
  -}
  -
  -
  -
   const AVT**
   StylesheetConstructionContextDefault::allocateAVTPointerVector(size_type	theLength)
   {
  -	const AVT**	theDummy;
  -
  -	return allocate(m_pointerVectorAllocator, theLength, theDummy);
  +	return doAllocateAVTPointerVector(theLength);
   }
   
   
  @@ -789,9 +766,7 @@
   const AVTPart**
   StylesheetConstructionContextDefault::allocateAVTPartPointerVector(size_type	theLength)
   {
  -	const AVTPart**	theDummy;
  -
  -	return allocate(m_pointerVectorAllocator, theLength, theDummy);
  +	return doAllocateAVTPartPointerVector(theLength);
   }
   
   
  @@ -829,7 +804,7 @@
   	}
   	else
   	{
  -		const XalanQName**	theResult = allocate(m_pointerVectorAllocator, count, theResult);
  +		const XalanQName**	theResult = doAllocateXalanQNamePointerVector(count);
   		assert(theResult != 0);
   
   		const GetAndReleaseCachedString		theGuard(*this);
  
  
  
  1.26      +42 -19    xml-xalan/c/src/XSLT/StylesheetConstructionContextDefault.hpp
  
  Index: StylesheetConstructionContextDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetConstructionContextDefault.hpp,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- StylesheetConstructionContextDefault.hpp	31 Oct 2002 07:15:56 -0000	1.25
  +++ StylesheetConstructionContextDefault.hpp	1 Nov 2002 01:36:28 -0000	1.26
  @@ -128,10 +128,7 @@
   public:
   
   	typedef XalanArrayAllocator<XalanDOMChar>			XalanDOMCharVectorAllocatorType;
  -	typedef XalanArrayAllocator<const AVT*>				XalanAVTPointerVectorAllocatorType;
  -	typedef XalanArrayAllocator<const AVTPart*>			XalanAVTPartPointerVectorAllocatorType;
  -	typedef XalanArrayAllocator<const XalanQName*>		XalanQNameVectorAllocatorType;
  -	typedef XalanArrayAllocator<const void*>			XalanVoidPointerVectorAllocatorType;
  +	typedef XalanArrayAllocator<const void*>			PointerVectorAllocatorType;
   	typedef XalanDOMCharVectorAllocatorType::size_type	VectorAllocatorSizeType;
   
       // Default size for vector allocation.
  @@ -140,10 +137,8 @@
   			eDefaultAVTBlockSize = 128,
   			eDefaultAVTPartSimpleBlockSize = 128,
   			eDefaultAVTPartXPathBlockSize = 128,
  -			eDefaultAVTPointerVectorBlockSize = 512,
  -			eDefaultAVTPartPointerVectorBlockSize = 512,
   			eDefaultXalanQNameByValueBlockSize = 32,
  -			eDefaultXalanQNamePointerVectorBlockSize = 512 };
  +			eDefaultPointerVectorBlockSize = 512 };
   
   	/*
   	 * Construct an instance.  If the stylesheet(s) constructed is/are meant to be reused
(a.k.a. "compiled"),
  @@ -158,9 +153,8 @@
   	 * @param theAVTAllocatorBlockSize The block size to use for allocating AVT instances.
   	 * @param theAVTPartSimpleAllocatorBlockSize The block size to use for allocating AVTPartSimple
instances.
   	 * @param theAVTPartXPathAllocatorBlockSize The block size to use for allocating AVTPartXPath
instances.
  -	 * @param theAVTPartPointerVectorAllocatorBlockSize The block size to use for allocating
vectors of AVTPart pointers.
   	 * @param theXalanQNameByValueAllocatorBlockSize The block size to use for allocating
XalanQNameByValue instances.
  -	 * @param theAVTPartPointerVectorAllocatorBlockSize The block size to use for allocating
vectors of AVTPart pointers.
  +	 * @param thePointerVectorAllocatorBlockSize The block size to use for allocating vectors
of pointers.
   	 */
   	StylesheetConstructionContextDefault(
   			XSLTEngineImpl&							processor,
  @@ -169,10 +163,8 @@
   			XalanAVTAllocator::size_type			theAVTAllocatorBlockSize = eDefaultAVTBlockSize,
   			XalanAVTPartSimpleAllocator::size_type	theAVTPartSimpleAllocatorBlockSize = eDefaultAVTPartSimpleBlockSize,
   			XalanAVTPartXPathAllocator::size_type	theAVTPartXPathAllocatorBlockSize = eDefaultAVTPartXPathBlockSize,
  -			VectorAllocatorSizeType					theAVTPointerVectorAllocatorBlockSize = eDefaultAVTPointerVectorBlockSize,
  -			VectorAllocatorSizeType					theAVTPartPointerVectorAllocatorBlockSize = eDefaultAVTPartPointerVectorBlockSize,
   			XalanQNameByValueAllocator::size_type	theXalanQNameByValueAllocatorBlockSize = eDefaultXalanQNameByValueBlockSize,
  -			VectorAllocatorSizeType					theXalanQNamePointerVectorAllocatorBlockSize = eDefaultAVTPartPointerVectorBlockSize);
  +			VectorAllocatorSizeType					thePointerVectorAllocatorBlockSize = eDefaultPointerVectorBlockSize);
   
   	virtual
   	~StylesheetConstructionContextDefault();
  @@ -429,6 +421,43 @@
   
   private:
   
  +	const AVT**
  +	doAllocateAVTPointerVector(size_type	theSize)
  +	{
  +		assert(sizeof(AVT**) == sizeof(PointerVectorAllocatorType::value_type));
  +
  +#if defined(XALAN_OLD_STYLE_CASTS)
  +		return (const AVT**)m_pointerVectorAllocator.allocate(theSize);
  +#else
  +		return reinterpret_cast<const AVT**>(m_pointerVectorAllocator.allocate(theSize));
  +#endif
  +	}
  +
  +	const AVTPart**
  +	doAllocateAVTPartPointerVector(size_type	theSize)
  +	{
  +		assert(sizeof(AVTPart**) == sizeof(PointerVectorAllocatorType::value_type));
  +
  +#if defined(XALAN_OLD_STYLE_CASTS)
  +		return (const AVTPart**)m_pointerVectorAllocator.allocate(theSize);
  +#else
  +		return reinterpret_cast<const AVTPart**>(m_pointerVectorAllocator.allocate(theSize));
  +#endif
  +	}
  +
  +	const XalanQName**
  +	doAllocateXalanQNamePointerVector(size_type	theSize)
  +	{
  +		assert(sizeof(XalanQName**) == sizeof(PointerVectorAllocatorType::value_type));
  +
  +#if defined(XALAN_OLD_STYLE_CASTS)
  +		return (const XalanQName**)m_pointerVectorAllocator.allocate(theSize);
  +#else
  +		return reinterpret_cast<const XalanQName**>(m_pointerVectorAllocator.allocate(theSize));
  +#endif
  +	}
  +
  +
   	XSLTEngineImpl&							m_processor;
   
   	XPathFactory&							m_xpathFactory;
  @@ -455,17 +484,11 @@
   
   	XalanAVTPartXPathAllocator				m_avtPartXPathAllocator;
   
  -	XalanAVTPointerVectorAllocatorType		m_avtPointerVectorAllocator;
  -
  -	XalanAVTPartPointerVectorAllocatorType	m_avtPartPointerVectorAllocator;
  -
   	XalanQNameByValueAllocator				m_xalanQNameByValueAllocator;
   
  -	XalanQNameVectorAllocatorType			m_xalanQNameVectorAllocator;
  -
   	const XalanQNameByReference				m_useAttributeSetsQName;
   
  -	XalanVoidPointerVectorAllocatorType		m_pointerVectorAllocator;
  +	PointerVectorAllocatorType				m_pointerVectorAllocator;
   
   	static const XalanQNameByReference	s_spaceAttrQName;
   
  
  
  

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


Mime
View raw message