-
Content Count
344 -
Joined
-
Last visited
-
Days Won
4
Posts posted by Cristian Peța
-
-
I discovered this looking in FMX sources.
-
What if we would have [safe] attribute?
It would be very useful for local instances.
We have [unsafe] attribute but not [safe]. In ARC all instances are implicitly [safe] and we need to explicitly mark with [unsafe] if we don't want ARC.
I call this implicit ARC.
But with [safe] we can have explicit ARC where all instances are implicit [unsafe].
var ms := TStringList.Create; try ... finally ms.Free; end;
var [safe] ms := TStringList.Create; ...
Merged by Sherlock: Try to avoid double posts, please.
-
1
-
Directions for ARC Memory Management
in RTL and Delphi Object Pascal
Posted
I don't understand what would be wrong to enable ARC for objects and to consider [unsafe] as default. It will not brake old code. And using [safe] or [arc] we can have automatic memory management. At least for simple scenarios.