It is not clear how to structure and categorize source code files with purely standalone utility functions and types that are not directly related to Bitcoin or Bitcoin Core.
Currently there are:
- https://github.com/bitcoin/bitcoin/tree/master/src/compat (Seems to be a folder to provide util features that are missing on some systems)
- https://github.com/bitcoin/bitcoin/tree/master/src/support (Mostly memory related utils?)
- https://github.com/bitcoin/bitcoin/tree/master/src/util (Some Bitcoin Core related files, but also “cpp backports” such as
MakeUnique
) - https://github.com/bitcoin/bitcoin/blob/master/src/attributes.h (compiler attributes for function declarations)
- https://github.com/bitcoin/bitcoin/blob/master/src/compat.h
- https://github.com/bitcoin/bitcoin/blob/master/src/fs.h
- https://github.com/bitcoin/bitcoin/blob/master/src/optional.h (
std::optional
backport) - https://github.com/bitcoin/bitcoin/blob/master/src/indirectmap.h
- https://github.com/bitcoin/bitcoin/blob/master/src/limitedmap.h
- https://github.com/bitcoin/bitcoin/blob/master/src/memusage.h
- https://github.com/bitcoin/bitcoin/blob/master/src/reverselock.h
- https://github.com/bitcoin/bitcoin/blob/master/src/reverse_iterator.h
- https://github.com/bitcoin/bitcoin/blob/master/src/span.h (
std::span
backport) - https://github.com/bitcoin/bitcoin/blob/master/src/sync.h
- https://github.com/bitcoin/bitcoin/blob/master/src/threadsafety.h
This issue serves as a tracking issue for any brainstorming on the topic.