Re: [fpc-devel] compile time memory leak detection

2010-01-19 Thread Nikolai Zhubr
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

Re: [fpc-devel] compile time memory leak detection

2010-01-19 Thread Nikolai Zhubr
20.01.2010 0:22, Marco van de Voort: Totally different issue. The problem is that there was no implementation of memavail that would suit the usage of memavail in old dos code. That was the simple difference between single- and multiprocessing, which was ingrained in the use. Even the simple sh

Re: [fpc-devel] compile time memory leak detection

2010-01-19 Thread Marco van de Voort
In our previous episode, Nikolai Zhubr said: > 19.01.2010 23:18, Marco van de Voort: > > FPC is not going to forbid standard pointer use, since it breaks a lot of > > code. > Of course. I think it all was about new features for new code. > By the way, it reminds me MemAvail (though not exactly the

Re: [fpc-devel] compile time memory leak detection

2010-01-19 Thread Nikolai Zhubr
19.01.2010 23:18, Marco van de Voort: FPC is not going to forbid standard pointer use, since it breaks a lot of code. Of course. I think it all was about new features for new code. By the way, it reminds me MemAvail (though not exactly the same). Lots of code used to use it, however AFAIK it is

Re: [fpc-devel] compile time memory leak detection

2010-01-19 Thread Marco van de Voort
In our previous episode, Nikolai Zhubr said: > >p: pchar; > > begin > >GetMem(p,10); > >inc(p,random(30)); > > Yes, this is among things which should probably be immediately > disallowed at compile-time (as long as one wants reasonably safe > pointers) because they are hard (or expen

Re: [fpc-devel] compile time memory leak detection

2010-01-19 Thread Nikolai Zhubr
19.01.2010 17:49, JoshyFun пишет: var p: pchar; begin GetMem(p,10); inc(p,random(30)); Yes, this is among things which should probably be immediately disallowed at compile-time (as long as one wants reasonably safe pointers) because they are hard (or expensive) to validate later. I

Re: [fpc-devel] compile time memory leak detection

2010-01-19 Thread Nikolai Zhubr
19.01.2010 16:16, Thaddy: Nikolai Zhubr wrote: I'd guess this would require huge work and substantial modifications to the language though. The compiler then has to assert all possible codepaths... Do you think that's a viable option? I don't have that much expertise to judge really, but I'd

Re: [fpc-devel] compile time memory leak detection

2010-01-19 Thread Thaddy
Nikolai Zhubr wrote: I'd guess this would require huge work and substantial modifications to the language though. The compiler then has to assert all possible codepaths... Do you think that's a viable option? ___ fpc-devel maillist - fpc-devel@lists

Re: [fpc-devel] compile time memory leak detection

2010-01-19 Thread Nikolai Zhubr
19.01.2010 12:31, Jonas Maebe: Does FPC know how to find this places on compile time and at least issue a warning about it ? No, it doesn't. In principle, the compiler can't even be sure that you haven't replaced the default memory manager with e.g. some garbage-collector-style memory manager s

Re: [fpc-devel] compile time memory leak detection

2010-01-19 Thread Jonas Maebe
On 19 Jan 2010, at 09:35, ik wrote: There are sometimes way to "see" that you have memory leak in a code without using any sort of profiler. For example using new/getmem on a local variable without releasing it etc... Does FPC know how to find this places on compile time and at least is

Re: [fpc-devel] compile time memory leak detection

2010-01-19 Thread ik
http://ik.homelinux.org/ On Tue, Jan 19, 2010 at 10:59, Marco van de Voort wrote: > In our previous episode, ik said: > > There are sometimes way to "see" that you have memory leak in a code > without > > using any sort of profiler. > > For example using new/getmem on a local variable without r

Re: [fpc-devel] compile time memory leak detection

2010-01-19 Thread Marco van de Voort
In our previous episode, ik said: > There are sometimes way to "see" that you have memory leak in a code without > using any sort of profiler. > For example using new/getmem on a local variable without releasing it etc... > > Does FPC know how to find this places on compile time and at least issue