diff options
Diffstat (limited to 'source/core')
| -rw-r--r-- | source/core/slang-riff.cpp | 4 | ||||
| -rw-r--r-- | source/core/slang-riff.h | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/source/core/slang-riff.cpp b/source/core/slang-riff.cpp index 2162c40be..d64cd89c7 100644 --- a/source/core/slang-riff.cpp +++ b/source/core/slang-riff.cpp @@ -864,7 +864,7 @@ void RiffContainer::setPayload(Data* data, const void* payload, size_t size) data->m_ownership = Ownership::Arena; data->m_size = size; - data->m_payload = m_arena.allocateAligned(size, PAYLOAD_MIN_ALIGNMENT); + data->m_payload = m_arena.allocateAligned(size, kPayloadMinAlignment); if (payload) { @@ -941,7 +941,7 @@ RiffContainer::Data* RiffContainer::makeSingleData(DataChunk* dataChunk) // Okay lets combine all into one block const size_t payloadSize = dataChunk->calcPayloadSize(); - void* dst = m_arena.allocateAligned(payloadSize, PAYLOAD_MIN_ALIGNMENT); + void* dst = m_arena.allocateAligned(payloadSize, kPayloadMinAlignment); dataChunk->getPayload(dst); // Remove other datas diff --git a/source/core/slang-riff.h b/source/core/slang-riff.h index 43c5e285d..5a753b6d6 100644 --- a/source/core/slang-riff.h +++ b/source/core/slang-riff.h @@ -177,14 +177,11 @@ need to be recalculated, before serialization. class RiffContainer { public: - enum - { // This alignment is only made for arena based allocations. // For external blocks it's client code to have appropriate alignment. // This is needed because when reading a RiffContainer, all allocation is arena based, and // if the payload contains 8 byte aligned data, the overall payload needs to be 8 byte aligned. - PAYLOAD_MIN_ALIGNMENT = 8, - }; + static const size_t kPayloadMinAlignment = 8; enum class Ownership { |
