Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local version of #908 #917

Merged
merged 9 commits into from
Oct 8, 2024
Merged

Local version of #908 #917

merged 9 commits into from
Oct 8, 2024

Conversation

davidbeckingsale
Copy link
Member

No description provided.

msimberg and others added 9 commits September 6, 2024 11:49
…oalesced pool size

The non-actual high water mark does not include the overallocated size
when rounding user allocations up to the alignment. This means that the
non-actual high water mark may be too small when repeatedly allocating
and deallocating the same sizes in a pool, leading to unnecessary
reallocation of the backing buffers.
Comment on lines 42 to 45
// Total size allocated (bytes)
std::size_t m_aligned_bytes{0};
std::size_t m_aligned_highwatermark{0};
std::size_t m_actual_bytes{0};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Total size allocated (bytes)
std::size_t m_aligned_bytes{0};
std::size_t m_aligned_highwatermark{0};
std::size_t m_actual_bytes{0};
std::size_t m_aligned_bytes{0}; // Current size of pool, rounded up to alignment (bytes)
std::size_t m_aligned_highwatermark{0}; // Highwatermark of the aligned size (bytes)
std::size_t m_actual_bytes{0}; // Total size allocated (bytes)

std::size_t m_actual_bytes{0};
std::size_t m_current_size{0};
std::size_t m_actual_highwatermark{0};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::size_t m_actual_highwatermark{0};
std::size_t m_actual_highwatermark{0}; // Highwatermark of the actual size (bytes)

Comment on lines 79 to +81
std::size_t getActualHighwaterMark() const noexcept;
std::size_t getAlignedSize() const noexcept;
std::size_t getAlignedHighwaterMark() const noexcept;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::size_t getActualHighwaterMark() const noexcept;
std::size_t getAlignedSize() const noexcept;
std::size_t getAlignedHighwaterMark() const noexcept;
/*
* \brief Returns the Highwatermark of the total size allocated in bytes.
*/
std::size_t getActualHighwaterMark() const noexcept;
/*
* \brief Returns the current size of pool, rounded up to alignment in bytes.
*/
std::size_t getAlignedSize() const noexcept;
/*
* \brief Returns the Highwatermark of the aligned size in bytes.
*/
std::size_t getAlignedHighwaterMark() const noexcept;

@@ -76,8 +76,9 @@ class DynamicPoolList : public AllocationStrategy {
std::size_t getTotalBlocks() const noexcept;

std::size_t getActualSize() const noexcept override;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::size_t getActualSize() const noexcept override;
/*
* \brief Returns the total size allocated in bytes.
*/
std::size_t getActualSize() const noexcept override;

Comment on lines 165 to 169
std::size_t m_total_blocks{0};
std::size_t m_releasable_blocks{0};
std::size_t m_aligned_bytes{0};
std::size_t m_aligned_highwatermark{0};
std::size_t m_actual_bytes{0};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::size_t m_total_blocks{0};
std::size_t m_releasable_blocks{0};
std::size_t m_aligned_bytes{0};
std::size_t m_aligned_highwatermark{0};
std::size_t m_actual_bytes{0};
std::size_t m_total_blocks{0};
std::size_t m_releasable_blocks{0};
std::size_t m_aligned_bytes{0}; // Current size of the pool, rounded up to alignment
std::size_t m_aligned_highwatermark{0}; // Highwatermark of the aligned size
std::size_t m_actual_bytes{0}; // Total size allocated in bytes

std::size_t m_actual_bytes{0};
std::size_t m_current_bytes{0};
std::size_t m_releasable_bytes{0};
std::size_t m_actual_highwatermark{0};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::size_t m_actual_highwatermark{0};
std::size_t m_actual_highwatermark{0}; // Highwatermark of the actual size

tests/integration/primary_pool_tests.cpp Show resolved Hide resolved
@davidbeckingsale davidbeckingsale merged commit 20b2df6 into develop Oct 8, 2024
30 checks passed
@davidbeckingsale davidbeckingsale deleted the pr-from-fork/908 branch October 8, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants