Skip to content

Commit

Permalink
Fixing problem with Android armv7 optmization which causes alignment…
Browse files Browse the repository at this point in the history
… violation (bkaradzic#2188)

* Fixing problem with Android armv7 optmization which causes alignment violation
  • Loading branch information
BorisShir authored and rozgo committed Aug 14, 2020
1 parent ddc233e commit 62222df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bgfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 62222df

Please sign in to comment.