[orbis-kernel] Debugging

This commit is contained in:
Ivan Chikish 2023-07-05 11:38:31 +03:00
parent 4029711c2d
commit ed7580b322
3 changed files with 13 additions and 7 deletions

View file

@ -122,6 +122,8 @@ struct Module final {
unsigned _total_size = 0;
void incRef() {
if (_total_size != sizeof(Module))
std::abort();
if (references.fetch_add(1, std::memory_order::relaxed) > 512) {
assert(!"too many references");
}