Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/decodeless/allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ class linear_memory_resource {
}

[[nodiscard]] constexpr void* allocate(std::size_t bytes, std::size_t align) {
// Align
uintptr_t result = m_next + ((-static_cast<ptrdiff_t>(m_next)) & (align - 1));
// Align, assumes 'align' is a power of two
uintptr_t result = (m_next + align - 1) & ~(align - 1);

// Allocate
uintptr_t newNext = result + bytes;
Expand Down