From ea44650ae556a60df9d738a7d5d25259a02d6f3b Mon Sep 17 00:00:00 2001
From: Tinny Ng <tng@apache.org>
Date: Tue, 16 Jul 2002 12:27:12 +0000
Subject: [PATCH] [Bug 10648] DOMDocumentImpl misaligned allocations on
 machines with a 64 bits 'long' type.

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@174009 13f79535-47bb-0310-9956-ffa450edef68
---
 src/xercesc/dom/impl/DOMDocumentImpl.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/xercesc/dom/impl/DOMDocumentImpl.cpp b/src/xercesc/dom/impl/DOMDocumentImpl.cpp
index df136e41b..bdf084d42 100644
--- a/src/xercesc/dom/impl/DOMDocumentImpl.cpp
+++ b/src/xercesc/dom/impl/DOMDocumentImpl.cpp
@@ -714,7 +714,10 @@ static const int kMaxSubAllocationSize = 4096;   // Any request for more bytes
 void *         DOMDocumentImpl::allocate(size_t amount)
 {
 
-     size_t sizeOfPointer = sizeof(void *);
+//     size_t sizeOfPointer = sizeof(void *);
+// some MIPS or IA64 machines may misallign if the class has a long data type member
+// see Bug 10648 for details
+     size_t sizeOfPointer = sizeof(long);
      if (amount%sizeOfPointer!=0)
        amount = amount + (sizeOfPointer - (amount % sizeOfPointer));
 
-- 
GitLab