Skip to content
Snippets Groups Projects
Commit ea44650a authored by Tinny Ng's avatar Tinny Ng
Browse files

[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
parent 83dcba12
No related branches found
No related tags found
No related merge requests found
......@@ -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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment