|
From: zhangyan <zha...@ba...> - 2008-12-13 12:23:17
|
> No, the two things are unrelated. Whether you get "definitely" or
"possibly" > lost is largely a matter of luck -- if there are any values
that could conceivably > point into the middle of a block, it's considered
"possibly" lost. (See the 〉> manual for more explanation.) As you make
blocks bigger, this becomes more > likely.
Well,3ks you for explanation of report the warning of "set address range
perms",it's impressed.But to the second question,as you watch this source
file
#define N 79814486
void foo()
{
char *a=(char*)malloc(N);
}
int main()
{
foo();
return 0;
}
The memory allocated by (char*)malloc(N) is definitely lost,but why the
valgrind give me the "possibly lost".And do you think is there any possible
value points into the middle of the allocated block ??? if it's,what is the
value which points to the allocated block possibly???
I really appreciate your explanation of the warning as a developer,because
our company come across many warnings of this kind,and we are really worried
about that whether these warnings indicating our programs have a bunch of
bugs:-)
|