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 2008/02/06 20:06:01 UTC
svn commit: r619108 -
/xalan/c/trunk/src/xalanc/PlatformSupport/ReusableArenaBlock.hpp
Author: dbertoni
Date: Wed Feb 6 11:05:59 2008
New Revision: 619108
URL: http://svn.apache.org/viewvc?rev=619108&view=rev
Log:
Patch for XALANC-659.
Modified:
xalan/c/trunk/src/xalanc/PlatformSupport/ReusableArenaBlock.hpp
Modified: xalan/c/trunk/src/xalanc/PlatformSupport/ReusableArenaBlock.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/ReusableArenaBlock.hpp?rev=619108&r1=619107&r2=619108&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/ReusableArenaBlock.hpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/ReusableArenaBlock.hpp Wed Feb 6 11:05:59 2008
@@ -68,18 +68,6 @@
return ( ( verificationStamp == int(VALID_OBJECT_STAMP)) &&
( next <= rightBorder ) ) ? true : false ;
}
-
- static NextBlock*
- cast(void* thePointer)
- {
- return reinterpret_cast<NextBlock*>(thePointer);
- }
-
- static const NextBlock*
- cast(const void* thePointer)
- {
- return reinterpret_cast<const NextBlock*>(thePointer);
- }
};
/*
@@ -114,10 +102,7 @@
removedObjects < this->m_objectCount;
++i)
{
- NextBlock* const pStruct =
- NextBlock::cast(&this->m_objectBlock[i]);
-
- if ( isOccupiedBlock(pStruct) )
+ if ( isOccupiedBlock(&this->m_objectBlock[i]) )
{
this->m_objectBlock[i].~ObjectType();
@@ -176,9 +161,12 @@
assert(size_type(theResult - this->m_objectBlock) < this->m_blockSize);
- this->m_nextFreeBlock = NextBlock::cast(theResult)->next;
+ NextBlock* const theBlock =
+ reinterpret_cast<NextBlock*>(theResult);
+
+ this->m_nextFreeBlock = theBlock->next;
- assert(NextBlock::cast(theResult)->isValidFor(this->m_blockSize));
+ assert(theBlock->isValidFor(this->m_blockSize));
assert(this->m_nextFreeBlock <= this->m_blockSize);
++this->m_objectCount;
@@ -254,7 +242,7 @@
{
assert ( theObject != 0 );
- return isOccupiedBlock(NextBlock::cast(theObject));
+ return isOccupiedBlock(theObject);
}
protected:
@@ -277,12 +265,12 @@
}
bool
- isOccupiedBlock(const NextBlock* block) const
+ isOccupiedBlock(const ObjectType* block) const
{
assert( block !=0 );
- return !(this->ownsBlock(reinterpret_cast<const ObjectType*>(block)) &&
- block->isValidFor(this->m_blockSize));
+ return !(this->ownsBlock(block) &&
+ reinterpret_cast<const NextBlock*>(block)->isValidFor(this->m_blockSize));
}
private:
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org