Merge branch 'track-garbage' into 'master'

Track if garbage collection is necessary.

This is useful for precondition checks in client code.

PR includes the bugfix from !5

See merge request !6
7 jobs for master in 3 minutes and 34 seconds
Status Name Job ID Coverage
  Test
passed clang-c++11 #9771
Linux

00:02:22

passed clang-c++98 #9773
Linux

00:01:51

passed cppcheck #9776
Linux

00:01:51

passed gcc-c++11 #9770
Linux

00:03:34

passed gcc-c++98 #9772
Linux

00:02:39

passed macos-c++11 #9774
Apple

00:02:28

passed macos-c++98 #9775
Apple

00:02:18