Min Xu (Hsu) wrote:

I am confused by how valgrind define "make use" of data? Isn't
"copy" data a type of "make use"? I mean, if valgrind checks if the
data was used as inputs of memcpy(), it is fine. But if user uses
his own memory_copy(), which loads the data into register,
as if the data is going to be used in some useful computation,
and then copy the register value to some other memory location
to finish the copy (yeah, this IS slow), then valgrind is likely
to be confused too. It may think the data is "used".

I guess all I am saying is that valgrind _can_ still make
mistakes about it.

-Min


If I understand correctly, a data is defined to be "used" when anything other than copying is done on it. Arithmetic operations, branches, etc. will trigger the error. If you copy the data by adding and then subtracting a constant from it, valgrind will complain. If all you do (as in your example) is copy it around, and then copy it some more, it will not.

Yes, it does keep "uninitialized" bits over your registers. Brrr.

Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting
http://www.lingnu.com/


---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

Reply via email to