понедельник, 23 марта 2015 г.

Link. If there were an automatic memory manager (i.e. a garbage collector) for the version of Delphi you currently use what would you be willing to pay for it?

Original in Russian: http://18delphi.blogspot.ru/2015/03/link-if-there-were-automatic-memory.html

Link. If there were an automatic memory manager (i.e. a garbage collector) for the version of Delphi you currently use what would you be willing to pay for it?
https://plus.google.com/u/0/+KennethCochran/posts/gAjF4mQrkd8?cfem=1

It makes me laugh.

I’ve already written that I don’t like – About "hazards" of ARC and other “automats” (set of references) http://programmingmindstream.blogspot.ru/2014/10/arc.html

All the more I don’t like GC.

By the way, if you need ARC for Win 32, you should read:

Containers 2. My own implementation of IUnknown and reference counting. And mixins.
Containers 1. Implementation of reference counting.

REMEMBER that we can do like this:

type
 IMyClassPtr = interface;
 
 TMyClass = class
  ...
  class function CreatePtr: IMyClassPtr;
 end;//TMyClass
 
 IMyClassPtr = interface
  function AsHolded: TMyClass;
 end;//IMyClassPtr

Needless to remind you about Generic's.

(+) Records.
(+) Implicit.

Do you understand the idea?

AutoPtr сan be done something like this:

type
 TAutoPtr<T> = record
  class operator Implicit(aValue: <T>): TAutoPtr<T>;
  class operator Explicit(const aValue: TAutoPtr<T>): <T>;
 end;//TAutoPtr

Комментариев нет:

Отправить комментарий