Pool size is doubled on each ordered_malloc call
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Start by running the provided C++ sample and inspect the Boost pool implementation related to ordered_malloc(), ordered_free(), purge_memory(), and get_next_size(). Compare the behavior between Boost 1.70 and 1.88; done means repeated purge_memory() calls no longer cause the reported pool-size doubling.
Written by the indexing model from the issue text.
Description
Encountered a similar issue with: https://github.com/boostorg/pool/issues/54 when I upgraded from boost 1.70 to 1.88. Repeated use of purge_memory() results in pool size extension with two times the previous size when ordered_malloc is called.
Sample Code:
int main()
{
boost::pool<> bufferMemPool(sizeof(WCHAR), 32768);
for (int i = 0; i < 10; i++)
{
LPWSTR buffer = static_cast<LPWSTR>(bufferMemPool.ordered_malloc());
if (buffer) {
std::wcout << "get_next_size(): " << bufferMemPool.get_next_size() << std::endl;
bufferMemPool.ordered_free(buffer);
}
else {
std::wcerr << L"Memory allocation failed." << std::endl;
}
bufferMemPool.purge_memory();
}
return 0;
}
Output:
get_next_size(): 65536
get_next_size(): 131072
get_next_size(): 262144
get_next_size(): 524288
get_next_size(): 1048576
get_next_size(): 2097152
get_next_size(): 4194304
get_next_size(): 8388608
get_next_size(): 16777216
get_next_size(): 33554432
- Dominant language
- HTML
- Stars
- 8.6k
- Forks
- 2k
- Avg merge
- 9h 35m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/boost
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Similar issues
-
bug done
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
neavo/LinguaGacha#1124 ·
Maintainers usually reply within 1 day
-
module/http Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ballerina-platform/ballerina-library#9868 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
symgraph/GhidrAssistMCP#84 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
open-astro/AlpacaBridge#2606 · 1 comment ·
Maintainers usually reply within 1 day
-
reasons-gate
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
benthomasson/reasonsforge#100 ·
Maintainers usually reply within 1 day