Skip to content

Commit

Permalink
Merge pull request #16 from archonitelabs/alloc-fixup
Browse files Browse the repository at this point in the history
cleanup alloc concept
  • Loading branch information
jxy-s authored May 18, 2024
2 parents 44f0e81 + 6eaa8dc commit 03c41a3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion radiant/Memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Allocator

~Allocator() = default;

constexpr Allocator() = default;
constexpr Allocator() noexcept = default;

constexpr Allocator(const Allocator&) noexcept = default;

Expand Down
19 changes: 10 additions & 9 deletions test/TestAlloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Allocator

~Allocator() = default;

constexpr Allocator() = default;
constexpr Allocator() noexcept = default;

constexpr Allocator(const Allocator&) noexcept = default;

Expand Down Expand Up @@ -102,15 +102,15 @@ class StatefulAllocator
m_state = k_BadState;
}

StatefulAllocator()
StatefulAllocator() noexcept
: m_state(0)
{
}

StatefulAllocator(const StatefulAllocator&) noexcept = default;

template <typename U>
StatefulAllocator(const StatefulAllocator<U>& other)
StatefulAllocator(const StatefulAllocator<U>& other) noexcept
: m_state(other.m_state)
{
}
Expand Down Expand Up @@ -175,7 +175,7 @@ class FailingAllocator

~FailingAllocator() = default;

constexpr FailingAllocator() = default;
constexpr FailingAllocator() noexcept = default;

constexpr FailingAllocator(const FailingAllocator&) noexcept = default;

Expand Down Expand Up @@ -268,7 +268,7 @@ class CountingAllocator

~CountingAllocator() = default;

constexpr CountingAllocator() = default;
constexpr CountingAllocator() noexcept = default;

constexpr CountingAllocator(const CountingAllocator&) noexcept = default;

Expand Down Expand Up @@ -381,7 +381,7 @@ class StatefulCountingAllocator
m_state = k_BadState;
}

StatefulCountingAllocator()
StatefulCountingAllocator() noexcept
: m_state(0)
{
}
Expand All @@ -390,7 +390,8 @@ class StatefulCountingAllocator
default;

template <typename U>
StatefulCountingAllocator(const StatefulCountingAllocator<U>& other)
StatefulCountingAllocator(
const StatefulCountingAllocator<U>& other) noexcept
: m_state(other.m_state)
{
}
Expand Down Expand Up @@ -587,15 +588,15 @@ class AllocWrapper

~AllocWrapper() = default;

constexpr AllocWrapper(TBase& alloc)
constexpr AllocWrapper(TBase& alloc) noexcept
: base(&alloc)
{
}

constexpr AllocWrapper(const AllocWrapper&) noexcept = default;

template <typename U>
constexpr AllocWrapper(const AllocWrapper<U, TBase>& other)
constexpr AllocWrapper(const AllocWrapper<U, TBase>& other) noexcept
: base(other.base)
{
}
Expand Down

0 comments on commit 03c41a3

Please sign in to comment.