|
From: Julian S. <js...@ac...> - 2008-07-01 04:16:36
|
> thanks for reviving the branch. this was actually an open question to > Julian: is it guaranteed that the printf code is never used from multiple > threads? otherwise the static buffer used here in the ToXML() function > hurts. Er, no, I don't think it's thread safe, or at least it would be difficult to construct an argument that it would. It would be much better to have the caller allocate the buffer. Another thing is that this appears to break the module structure: +#include "pub_core_libcassert.h" /* vg_assert() */ +#include "pub_tool_libcprint.h" /* VG_(ToXML)() */ If this function's prototype is in pub_tool_libcprint.h then its implementation should be in m_libcprint, not in m_debuglog. Also, adding extra includes to m_debuglog.c is not allowed, as per big comment at the top of that file. As a result of uncontrolled #include-ing, earlier in the life of the project there was a circular dependency between m_aspacemgr and m_mallocfree, which caused a lot of trouble and was only removed at great effort. What is the reason for needing VG_(ToXML) anyway? I thought the XML output stuff worked OK as it is. J |