Valgrind 报告 "brk segment overflow in thread #1"
Valgrind reporting "brk segment overflow in thread #1"
我想知道这条消息意味着什么:
==18151== brk segment overflow in thread #1: can't grow to 0x4a26000
请注意,代码运行良好并且输出正确。我应该忽略这条消息吗?这是什么意思?
我觉得你可以忽略它。我在一些似乎运行良好的代码中的新分配中收到了消息,我还在以下代码中收到了消息:
#include <vector>
struct Something
{
Something() : a1(0), b1(0) { }
unsigned short a1;
unsigned short b1;
};
const int allocsize = 10000;
struct Tester
{
Tester()
{
for (int u = 0; u < allocsize; ++u)
data.push_back(new Something[519]);
}
~Tester()
{
for (int u = 0; u < allocsize; ++u)
delete[] (data[u]);
}
std::vector<Something*> data;
};
void test()
{
Tester t;
// while (true) {;}
}
int main()
{
test();
return 0;
}
我也注意到其他人也遇到了同样的问题:
Valgrind reporting a segment overflow
我想知道这条消息意味着什么:
==18151== brk segment overflow in thread #1: can't grow to 0x4a26000
请注意,代码运行良好并且输出正确。我应该忽略这条消息吗?这是什么意思?
我觉得你可以忽略它。我在一些似乎运行良好的代码中的新分配中收到了消息,我还在以下代码中收到了消息:
#include <vector>
struct Something
{
Something() : a1(0), b1(0) { }
unsigned short a1;
unsigned short b1;
};
const int allocsize = 10000;
struct Tester
{
Tester()
{
for (int u = 0; u < allocsize; ++u)
data.push_back(new Something[519]);
}
~Tester()
{
for (int u = 0; u < allocsize; ++u)
delete[] (data[u]);
}
std::vector<Something*> data;
};
void test()
{
Tester t;
// while (true) {;}
}
int main()
{
test();
return 0;
}
我也注意到其他人也遇到了同样的问题:
Valgrind reporting a segment overflow