summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-31 08:30:52 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-31 08:30:52 +0000
commit3bf16e10b40b992c10d5ed965830b483357df63f (patch)
treedcb25f569a073fb9a728eb4b36c9eca6df57fe77
parent3e8f9a6e2c4e9a63050b37fe7f6a5f09b0eee11f (diff)
XPath: Fixed alignment issues
git-svn-id: http://pugixml.googlecode.com/svn/trunk@198 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--src/pugixpath.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp
index 051d3b6..e7975ec 100644
--- a/src/pugixpath.cpp
+++ b/src/pugixpath.cpp
@@ -561,6 +561,9 @@ namespace pugi
void* alloc(size_t size)
{
+ // align size so that we're able to store pointers in subsequent blocks
+ size = (size + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
+
if (m_root->size + size <= xpath_memory_block_size)
{
void* buf = m_root->data + m_root->size;