Skip to content

Commit afe18dd

Browse files
committed
asset: pass correct arg to is_aligned
Signed-off-by: Ali Cheraghi <alichraghi@proton.me>
1 parent cf9a866 commit afe18dd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

include/nbl/core/alloc/VectorViewNullMemoryResource.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,22 @@ class VectorViewNullMemoryResource : public std::pmr::memory_resource
2727
}
2828

2929
protected:
30-
void* do_allocate(size_t bytes, size_t alignment) override {
31-
if (already_called || bytes > buffer.size() || !core::is_aligned_to(bytes, alignment))
30+
void* do_allocate(size_t bytes, size_t alignment) override
31+
{
32+
if (already_called || bytes > buffer.size() || !core::is_aligned_to(buffer.data(), alignment))
3233
return nullptr;
3334
already_called = true;
3435
return buffer.data();
3536
}
3637

37-
void do_deallocate(void* p, size_t bytes, size_t alignment) override {
38+
void do_deallocate(void* p, size_t bytes, size_t alignment) override
39+
{
3840
assert(p == buffer.data());
41+
already_called = false;
3942
}
4043

41-
bool do_is_equal(const std::pmr::memory_resource& other) const noexcept override {
44+
bool do_is_equal(const std::pmr::memory_resource& other) const noexcept override
45+
{
4246
return this == &other;
4347
}
4448

0 commit comments

Comments
 (0)