As I've been looking at my diffs for IDDocumentImpl.cpp a little more, I've
realized I forgot two things.  One is that I need to decrement the
fFreeBytesRemaining value if offsetting the pointer.  And the other is that
this should be done before seeing if there is enough room in our current
block for the new allocation.

So the new diffs would be:
*** IDDocumentImpl.cpp  Wed Aug  1 15:19:13 2001
--- IDDocumentImpl.cpp.new      Wed Aug  1 17:04:58 2001
***************
*** 884,893 ****
              fFreePtr = 0;
              fFreeBytesRemaining = 0;
          }
!         void *retPtr = (char *)newBlock + 4;
          return retPtr;
      }


      // It's a normal (sub-allocatable) request.
      if (amount > fFreeBytesRemaining)
--- 884,900 ----
              fFreePtr = 0;
              fFreeBytesRemaining = 0;
          }
!         void *retPtr = (char *)newBlock + sizeof(void *);
          return retPtr;
      }

+ #ifdef TRU64
+     int ptrOffset = ((unsigned long)fFreePtr)%sizeof(void *);
+     if ( ptrOffset != 0 )
+     {   fFreePtr = fFreePtr + sizeof(void *) - ptrOffset;
+         fFreeBytesRemaining = fFreeBytesRemaining + ptrOffset -
sizeof(void *);
+     }
+ #endif

      // It's a normal (sub-allocatable) request.
      if (amount > fFreeBytesRemaining)

Thanks again,
Kari

>
> ----- Original Message -----
> From: "Martin Kalen" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 31, 2001 12:26 AM
> Subject: Re: Unaligned Access warnings in IDOM samples
>
>
> > ----- Original Message -----
> > From: "Tinny Ng" <[EMAIL PROTECTED]>
> > Sent: Tuesday, July 31, 2001 5:28 AM
> >
> > > Ring some bells, but before going further, may be can you first
explain
> > to me
> > > what does "-assume noaligned-objects" do?  I am not familiar to TRU64
> > Unix....
> >
> > It has to do with the Alpha 64bit architecture: correct aligned data (a
> > "quadword" of 64bit) will be fetched directly from the MMU but
misaligned
> > data generates a fetch + mask + shift (eg. the CPU has to do some work
as
> > well).
> >
> > See
> > http://csa.compaq.com/Dev_Tips/unalign.htm
> > for some tips about why this happens and instructions on pinpointing
what
> > code that is generating the warnings.
> >
> > It's not neccessary any big downside of turning the warnings off with
"uac
> > p 0", but it's probably best to find out where in Xerces this is
happening
> > and see if it can easily be fixed. If it can, then other 64bit
> > architectures such as HP-PA might also run faster.
> >
> > Regards,
> >  Martin.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to