BrunoK: I would see the code with time... But i'm trying doing it without use of internal compiler structures.
@sash
It looks like you're ignoring comments and documentation.
It is very strange, your goal (???) is to trace proper memory allocation cycles for every object in application (rtl, fcl, lcl...), yet you didn't follow standard Pascal resource usage pattern (create-try-use-finally-free) in your (even test case) code.
No offense, but your task and efforts are complete mystery to me.
No offense
. The try...finally boilerplate code i'm not using for testing behaviour because it could mask other things. And i'm trying very simple things, so i'm not going for the full template.
The documentation says what you and i have posted, but documentation Do Not Say how a method
Called by the Compiler like afterconstruction would be called if hidden. When i read the doc, i don't understand this would apply for these two so clearly. This method isn't called from a Class. So i have tested it. The method behaves like called from a method inside TObject, but as we know, TObject.create doesn't call it. So it's a special method with a special call and fired by the compiler to a fixed destination like calling it as self.afterconstruction...
As i said, it's a theoreticall work on how the compiler works. I seldom use LCL, for example, for graphics i usually go with SDL2.
On my own classes, i use a Tobject descendant to make all the traces and all my classes descend from it, and it has all the boilerplate needed