Next: Source Code Organization, Previous: Sending Patches, Up: Contributing [Contents][Index]
MicroBenchmark follows to GNU Coding Standards
(see GNU Coding Standards) for its source code
and build process. The command make indent-code
can be used
to format the source code the script
build-aux/indent-code.sh6.
In addition to them, these are some common ideas of the code base:
_create
on their suffix allocate the object
memory, which must be released through the corresponding
_release
function. Functions with _init
and
_cleanup
work on objects already allocated and must go in pairs
too.
The self test empty
is a good baseline for checking introduced
overheads.
On the other hand, optimizations outside the critical path (i.e. test state code paths) are only worth the effort if the readability gets affected.
indent
outputs an
undesired format on certain C constructions such as guard macros. The
problematic source lines have comments /* *INDENT-ON* */
and
/* *INDENT-OFF* */
surrounding them to avoid its modification.
Patches for indent-code.sh to instruct indent
about these
cases are very welcome.