The implementation of the buffer API and File API share almost identical code causing lots of duplicate update work. This patch refactors the implementation using a writer callback mechanism.
Details
Diff Detail
Event Timeline
Thanks, just a few nits --
lib/profile/InstrProfilingBuffer.c | ||
---|---|---|
44–50 | ElmS -> ElmSize? | |
44–50 | C code in compiler-rt looks like it uses all lowercase and "_" separators in function names. We should preserve that style. | |
lib/profile/InstrProfilingFile.c | ||
20–22 | Same ElmS nit | |
lib/profile/InstrProfilingWriter.c | ||
58 | CHECK_fwrite -> CHECK_write |
lib/profile/InstrProfilingBuffer.c | ||
---|---|---|
44–50 | yes public C APIs are all lower cases, but these two new functions are internal APIs (just like existing functions like writeFile etc). They have global linkage mainly because the cross module references. |
ElmS -> ElmSize?