Skip to content

Commit

Permalink
Cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Epixu committed Jan 30, 2024
1 parent 5540e91 commit 5152346
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions source/Allocation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ namespace Langulus::Fractalloc
Allocation(Allocation&&) = delete;
~Allocation() = delete;

constexpr Allocation(const Size&, Pool*) noexcept;
constexpr Allocation(Size, Pool*) noexcept;

NOD() static constexpr Size GetSize() noexcept;
NOD() static constexpr Size GetNewAllocationSize(const Size&) noexcept;
NOD() static constexpr Size GetNewAllocationSize(Size) noexcept;
NOD() static constexpr Size GetMinAllocation() noexcept;

NOD() constexpr const Count& GetUses() const noexcept;
Expand All @@ -70,9 +70,9 @@ namespace Langulus::Fractalloc
NOD() T* As() const noexcept;

constexpr void Keep() noexcept;
constexpr void Keep(const Count&) noexcept;
constexpr void Keep(Count) noexcept;
constexpr void Free() noexcept;
constexpr void Free(const Count&) noexcept;
constexpr void Free(Count) noexcept;
};

} // namespace Langulus::Anyness
Expand Down
11 changes: 5 additions & 6 deletions source/Allocation.inl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace Langulus::Fractalloc
/// @param bytes - the number of allocated bytes
/// @param pool - the pool/handle of the entry
LANGULUS(INLINED)
constexpr Allocation::Allocation(const Size& bytes, Pool* pool) noexcept
constexpr Allocation::Allocation(Size bytes, Pool* pool) noexcept
: mAllocatedBytes {bytes}
, mReferences {1}
, mPool {pool} {}
Expand All @@ -81,7 +81,7 @@ namespace Langulus::Fractalloc
/// @param size - the usable number of bytes required
/// @return the byte size for a new Allocation, including padding
LANGULUS(INLINED)
constexpr Size Allocation::GetNewAllocationSize(const Size& size) noexcept {
constexpr Size Allocation::GetNewAllocationSize(Size size) noexcept {
const Size minimum = Allocation::GetMinAllocation();
const Size proposed = Allocation::GetSize() + size;
return ::std::max(proposed, minimum);
Expand Down Expand Up @@ -153,8 +153,7 @@ namespace Langulus::Fractalloc

/// Get the start of the entry as a given type
/// @return a pointer to the first element
template<class T>
LANGULUS(INLINED)
template<class T> LANGULUS(INLINED)
T* Allocation::As() const noexcept {
return reinterpret_cast<T*>(
const_cast<Allocation*>(this)->GetBlockStart());
Expand All @@ -169,7 +168,7 @@ namespace Langulus::Fractalloc
/// Reference the entry 'c' times
/// @param c - the number of references to add
LANGULUS(INLINED)
constexpr void Allocation::Keep(const Count& c) noexcept {
constexpr void Allocation::Keep(Count c) noexcept {
mReferences += c;
}

Expand All @@ -182,7 +181,7 @@ namespace Langulus::Fractalloc
/// Dereference the entry 'c' times
/// @param c - the number of references to remove
LANGULUS(INLINED)
constexpr void Allocation::Free(const Count& c) noexcept {
constexpr void Allocation::Free(Count c) noexcept {
mReferences -= c;
}

Expand Down

0 comments on commit 5152346

Please sign in to comment.