[fpc-devel] compile time memory leak detection

Nikolai Zhubr zhubr at mail.ru
Tue Jan 19 23:41:23 CET 2010

20.01.2010 0:29, JoshyFun:
> Pointers and safe code is mutually exclusive, like managed code and
I use pointers quite a lot. The code then works 24/7 for months under
some continuous load. (Still, I'd be even happier if compiler/RTL 
double-checked my code additionally.)

> fast execution, garbage collection and memory optimization, ...
I'm no expert in GCs, but it seems too general.
> In example this will work in some machines and crash in others:
> GetMem(p,1024*1024*1024);
> p^:=#0;
> You can not detect it a compile time in any way.

Sure, however this code is actually safe. (if allocation was 
successfull, then execution goes on normally, otherwise an exception 
will be raised on all reasonable platforms I suppose)


More information about the fpc-devel mailing list