|
From: Michael R. <mr...@us...> - 2004-08-20 09:58:19
|
Update of /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv875/src/main/org/openorb/orb/io Modified Files: MarshalBuffer.java Log Message: A call to size() does another call to prealloc() but that has already been done Index: MarshalBuffer.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/io/MarshalBuffer.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- MarshalBuffer.java 12 Aug 2004 12:54:24 -0000 1.9 +++ MarshalBuffer.java 20 Aug 2004 09:58:10 -0000 1.10 @@ -23,7 +23,7 @@ public class MarshalBuffer { private static final boolean DEBUG_ENABLED = - Boolean.getBoolean( System.getProperty( "openorb.debug.enabled" ) ); + Boolean.getBoolean( "openorb.debug.enabled" ); private Logger m_logger; @@ -493,7 +493,7 @@ hd.m_lastHeaderFragment = m_header_fragment; - hd.m_position = size(); + hd.m_position = m_tail.m_fPosition; hd.m_generator = gen; @@ -561,7 +561,7 @@ m_last_block = bd; - bd.m_position = size(); + bd.m_position = m_tail.m_fPosition; bd.m_generator = gen; @@ -604,6 +604,8 @@ { throw new IllegalStateException( "End block without begin block" ); } + + // size() calls prealloc() and maybe postalloc()! m_last_block.m_generator.endBlock( m_last_block.m_buffer, m_last_block.m_offset, m_last_block.m_length, size() - m_last_block.m_position, m_last_block.m_cookie ); @@ -740,7 +742,7 @@ BlockData bd = m_last_block; m_last_block = null; bd.m_generator.fragmentBlock( bd.m_buffer, bd.m_offset, bd.m_length, - size() - bd.m_position, this, bd.m_cookie ); + m_tail.m_fPosition - bd.m_position, this, bd.m_cookie ); } int endpos = len + m_head.m_fPosition - m_head.m_fLength; @@ -810,7 +812,6 @@ m_tail.m_fMode = Scrap.SCRAP_MODE_NORMAL; m_tail.m_fPosition = endpos; - // call begin block on all the header blocks while ( firstHeader != null ) { firstHeader.m_generator.beginMessage( this, firstHeader.m_cookie ); |