Uberto Barbini wrote:
I also thought immediately what Uberto already said: how do you recognize
a valid/invalid reference without accessing memory that is invalid in the
mean time.

How does a GC do this? It would have the same problem?


A GC dont' try to recognize a valid/invalid reference, it is invoked to free unused memory, which it assume point to valid memory.

A GC needs to trace an object's references to see if anything still points to it. How else can it decide whether an object is no longer in use?




Anyway I still don't understand the goal of this discussion.
Do you want to add some managed object in fpc? OK, but I suggest to start studing how GC works in Java, Python and dotnet.

I dont want a full blown GC just a way to speed up ref counting so that it can be used elsewhere.



As for me I'd rather ask for not managed Interfaces in Delphi (fpc ones are ok).

You already have them in Iunknown, ansistrings and variants. Its all a question of making them faster cause they are dog slow atm.


jamie.

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to