XPath: Fixed alignment issues

git-svn-id: http://pugixml.googlecode.com/svn/trunk@198 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
arseny.kapoulkine 2009-10-31 08:30:52 +00:00
parent 3e8f9a6e2c
commit 3bf16e10b4

View file

@ -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;