| 103 | void created(void *inst) { ++_instances[inst]; } |
| 104 | |
| 105 | void destroyed(void *inst) { |
| 106 | if (--_instances[inst] < 0) { |
| 107 | throw std::runtime_error("cstats.destroyed() called with unknown " |
| 108 | "instance; potential double-destruction " |
| 109 | "or a missing cstats.created()"); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | static void gc() { |
| 114 | // Force garbage collection to ensure any pending destructors are invoked: |