Load and destroy methods revised for proper reference counting

The update enhances object management by involving scope-based reference counting. The change affects loading and destruction operations in the Object and several other classes, ensuring the release or retention of objects adhere to their usage context. A function for logging type data has also been introduced to provide better clarity during debugging. Also, tests in script & interpreter have been altered to run in separate module initializations to avoid cross-test interference. Overall, it provides better memory management and dependable tests.
This commit is contained in:
IlushaShurupov 2023-08-01 20:05:29 +03:00 committed by Ilya Shurupov
parent ab0edfc302
commit 3f4f2caf1f
12 changed files with 58 additions and 10 deletions

View file

@ -18,12 +18,19 @@ int main() {
tp::ModuleManifest module("ObjectsTests", nullptr, nullptr, deps);
if (module.initialize()) {
testCore();
testPrimitives();
testInterpreter();
module.deinitialize();
}
if (module.initialize()) {
testPrimitives();
module.deinitialize();
}
if (module.initialize()) {
testInterpreter();
module.deinitialize();
}
return 0;
}

View file

@ -31,8 +31,8 @@ TEST_DEF_STATIC(Simple) {
interpreterLoaded->exec();
NDO->destroy(interpreter);
NDO->destroy(interpreterLoaded);
NDO->destroy(interpreter);
}
TEST_DEF(Interpreter) {