Pool size is doubled on each ordered_malloc call
还没有人认领这个 Issue。
评估
调研方向
首先运行提供的 C++ 示例,并检查与 ordered_malloc()、ordered_free()、purge_memory() 和 get_next_size() 相关的 Boost pool 实现。比较 Boost 1.70 和 1.88 之间的行为;当重复调用 purge_memory() 不再导致报告的 pool 大小翻倍时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- HTML
- 星标
- 8.6k
- 派生
- 2k
- 平均合并
- 9 小时 35 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
boostorg/boost 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 52/100
-
难度 3/5 1-2 天 新手友好度 55/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 48/100
相似的 Issue
-
bug done
难度 2/5 1-3 小时 新手友好度 65/100
neavo/LinguaGacha#1124 ·
维护者通常 1 天内回复
-
module/http Type/Bug
难度 2/5 1-3 小时 新手友好度 72/100
ballerina-platform/ballerina-library#9868 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
symgraph/GhidrAssistMCP#84 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
open-astro/AlpacaBridge#2606 · 1 条评论 ·
维护者通常 1 天内回复
-
reasons-gate
难度 2/5 1-3 小时 新手友好度 62/100
benthomasson/reasonsforge#100 ·
维护者通常 1 天内回复