From 3bf16e10b40b992c10d5ed965830b483357df63f Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sat, 31 Oct 2009 08:30:52 +0000 Subject: XPath: Fixed alignment issues git-svn-id: http://pugixml.googlecode.com/svn/trunk@198 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixpath.cpp | 3 +++ 1 file changed, 3 insertions(+) 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; -- cgit v1.2.3