XPath: Increase memory block alignment to 8 bytes
To be more precise, the memory block is now aligned to be able to reliably allocate objects with both double and pointer fields. If there is a platform with a 4-byte double and a 4-byte pointer, the memory block alignment there will stay the same after this change. Fixes #48.
This commit is contained in:
parent
e8fdd1303c
commit
bd7a8fa4bf
1 changed files with 6 additions and 2 deletions
|
@ -7267,14 +7267,18 @@ PUGI__NS_BEGIN
|
|||
#endif
|
||||
;
|
||||
|
||||
static const uintptr_t xpath_memory_block_alignment = sizeof(void*);
|
||||
static const uintptr_t xpath_memory_block_alignment = sizeof(double) > sizeof(void*) ? sizeof(double) : sizeof(void*);
|
||||
|
||||
struct xpath_memory_block
|
||||
{
|
||||
xpath_memory_block* next;
|
||||
size_t capacity;
|
||||
|
||||
char data[xpath_memory_page_size];
|
||||
union
|
||||
{
|
||||
char data[xpath_memory_page_size];
|
||||
double alignment;
|
||||
};
|
||||
};
|
||||
|
||||
class xpath_allocator
|
||||
|
|
Loading…
Add table
Reference in a new issue