On 2012/03/20 19:26:26, eraman wrote:
http://codereview.appspot.com/5851044/diff/1/callgraph.c
File callgraph.c (right):


http://codereview.appspot.com/5851044/diff/1/callgraph.c#newcode513
callgraph.c:513: const int section_priority[] = {0, 3, 4, 2, 1};
Add a comment about section_priority

Done.


http://codereview.appspot.com/5851044/diff/1/callgraph.c#newcode571
callgraph.c:571: if (section_priority[kept->section_type]
Add an example that shows why we want to do that

I added a comment.


http://codereview.appspot.com/5851044/diff/1/callgraph.c#newcode655
callgraph.c:655: write_out_node (n_it->name, &section_start[0],
&section_end[0]);
In write_out_node, why take the function name and do a hash table
lookup to get
the section, instead of directly passing Section_id * in the caller.
In all
calls to write_out_node, you are in fact getting the name from the
Section_id *.

That is not true, I pass the Node * in the first two calls. What you
said holds for the other calls. So, I made this more efficient.


http://codereview.appspot.com/5851044/diff/1/callgraph.c#newcode674
callgraph.c:674: s_it->processed = 1;
setting processed to 1 is redundant as it is already done in
write_out_node.

Done.


http://codereview.appspot.com/5851044/diff/1/callgraph.h
File callgraph.h (right):

http://codereview.appspot.com/5851044/diff/1/callgraph.h#newcode31
callgraph.h:31: void push_mm_ptr (void *ptr);
push_allocated_ptr or save_allocated_ptr would be a better name.


Done.

http://codereview.appspot.com/5851044/diff/1/callgraph.h#newcode48
callgraph.h:48: push_mm_ptr (list);
It might be cleaner to create a wrapper around XNEW that calls
push_mm_ptr after
XNEW. Similar for malloc as well.

Done.

http://codereview.appspot.com/5851044/

Reply via email to