|
From: Dannie S. <dan...@gm...> - 2010-04-08 15:25:34
|
I am creating a dynamic data dependency valgrind tool for class. I would like make use of the xarray and hashtable available in the includes. I have successfully used them but I am not sure on a couple of the details and was hoping that you could help; 1) The VG_(HT_construct) requires a parmeter of HChar*, what is the purpose of this value? Is it like a unique key? If I need to dynamically create hashtables what is a good way to assign this value? I assume that they can't all have the same value. 2) For VG_(malloc), I don't think I will be using the cc parameter, is it safe just to just use the same cc value everywhere (like "foo") Thanks, Dannie |
|
From: Nicholas N. <n.n...@gm...> - 2010-04-09 05:17:24
|
On Thu, Apr 8, 2010 at 8:25 AM, Dannie Stanley <dan...@gm...> wrote: > > 1) The VG_(HT_construct) requires a parmeter of HChar*, what is the > purpose of this value? Is it like a unique key? If I need to > dynamically create hashtables what is a good way to assign this value? > I assume that they can't all have the same value. It's just a name for debugging purposes, look in coregrind/m_hashtable.c for details. I'd use a different name for each VG_(HT_construct)() call site. > 2) For VG_(malloc), I don't think I will be using the cc parameter, is > it safe just to just use the same cc value everywhere (like "foo") This is used for profiling purposes. Again, just use a different string for each call site. BTW, do you know about Redux? http://www.valgrind.org/njn/pubs/redux2003.ps Nick |