Fixing problem with Android armv7 optmization which causes alignment violation (#2188)

* Fixing problem with Android armv7 optmization which causes alignment violation
This commit is contained in:
BorisShir 2020-06-30 18:30:30 +03:00 committed by GitHub
parent 1ae3b630cb
commit 290ffcf341
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1869,7 +1869,7 @@ namespace bgfx
frameNoRenderWait();
m_encoderHandle = bx::createHandleAlloc(g_allocator, _init.limits.maxEncoders);
m_encoder = (EncoderImpl*)BX_ALLOC(g_allocator, sizeof(EncoderImpl)*_init.limits.maxEncoders);
m_encoder = (EncoderImpl*)BX_ALIGNED_ALLOC(g_allocator, sizeof(EncoderImpl)*_init.limits.maxEncoders, 16);
m_encoderStats = (EncoderStats*)BX_ALLOC(g_allocator, sizeof(EncoderStats)*_init.limits.maxEncoders);
for (uint32_t ii = 0, num = _init.limits.maxEncoders; ii < num; ++ii)
{
@ -1975,7 +1975,7 @@ namespace bgfx
{
m_encoder[ii].~EncoderImpl();
}
BX_FREE(g_allocator, m_encoder);
BX_ALIGNED_FREE(g_allocator, m_encoder, 16);
BX_FREE(g_allocator, m_encoderStats);
m_dynVertexBufferAllocator.compact();