Allocate without GC?


(Javier Hernandez) #21

Delphi RTL supports ARC and NON ARC projects… hence apparently it’s usefull :slight_smile:

(marc hoffman) #22

That, or it’s a sign that Delphi was created in 1994.

(Javier Hernandez) #23

That doesn’t matter. Show me one example where GC beats a manually managed memory application.
If one would want a GC he or she would use C#, Java etc.

Even a concurent GC would still freeze.

Great example.

(Carlo Kok) #24

In most cases those “pauses” are not noticeable. In any case, I already enumerated the advantages of a gc above.

(Isral) #25

When Xamarin become free, I try it to make an Android game (for learning purpose).
It’s just 2D game but I notice some freezes.
It’s make my animation not smooth.
I minimize the freeze by dong frequent gc when freeze accepted (when AI thinking next move).

Also I think OpenGL resources like textures management better handled by ARC, not GC.

The tag is not SIlver, but I hope I can use Swift ARC (not GC) in Silver on Windows and Android NDK.

(marc hoffman) #26

Island isn;t Xamarin, and Island isn’t .NET. Maybe give it a try and see how GC performs before condemning it?

(dfndr) #27

While I agree with this… there are certain API’s that need a stable memory buffer. So how to achieve this with a GC?

(Fredy Ferrari) #28

Under .NET you can pin memory and then GC will not touch or move it.
So, I don’t know about the internal GC used for non .NET compilers.

(dfndr) #29

Xamarin compiles to native too I think and they use GC also.

(Carlo Kok) #30

You can just do:

var lArr =new Byte[2048];
ReadFile(fHandle, @lArr[0], 2048)

and it won’t gc “larr”.

(dfndr) #31

Right. How do I free it?

(Carlo Kok) #32

The GC will take care of that…