alignment: use proper alignment size

Pass proper alignment size when use allocate_align(). This will
fix alignment trap issues on ARM.

Signed-off-by: Beilu Shao <beilushao@gmail.com>
This commit is contained in:
Beilu Shao
2016-10-16 23:59:13 +02:00
parent 87ff7e4ccc
commit b4786711df
38 changed files with 163 additions and 150 deletions

View File

@@ -184,7 +184,6 @@ public:
void swap(zone& o);
static void* operator new(std::size_t size)
{
void* p = ::malloc(size);
@@ -329,7 +328,7 @@ inline void zone::undo_allocate(size_t size)
template <typename T, typename... Args>
T* zone::allocate(Args... args)
{
void* x = allocate_align(sizeof(T));
void* x = allocate_align(sizeof(T), MSGPACK_ZONE_ALIGNOF(T));
try {
m_finalizer_array.push(&zone::object_destruct<T>, x);
} catch (...) {