Re: [fpc-devel] fpc 14894 svn does not compile

2010-02-13 Thread Jonas Maebe

On 13 Feb 2010, at 03:06, ABorka wrote:

 gives the following error for make all (win xp 32bit)

Are you starting the compilation with FPC 2.4.0?


Jonas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] fpc 14894 svn does not compile

2010-02-13 Thread Burkhard Carstens
Am Samstag, 13. Februar 2010 11:15 schrieb Jonas Maebe:
 On 13 Feb 2010, at 11:10, ABorka wrote:
  My ppc386.exe is v2.5.1 compiled back in September

 Building FPC svn trunk has always been and will always be only
 supported when starting using the compiler the latest official
 release (which is 2.4.0 at this time).

  Is there a place when I can download the newer binary files/utils
  needed for the compile if that is the problem?

 You can download the latest release from the website.

It would be nice to have a minimum binary package(*) for those who 
usually compile svn.
(*) for linux, this would contain only ppc386-240, which is only 770K as 
tar.bz2 (or 821K as tar.gz) instead of 26MB/34MB of rpm/
one-big-file.tar.

regards
 Burkhard

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] GetHeapStatus.TotalAllocated

2010-02-13 Thread Nikolai Zhubr

Hello people,

after switching to FPC 2.4.0 I've noticed that:

1) GetHeapStatus.TotalAllocated does not seem to reflect size of 
allocations made by other threads anymore (I can provide a small 
example). I think such behaviour is not quite correct.


2) GetHeapStatus.TotalAllocated sometimes return negative values, though 
I haven't been able to prepare a reasonably small example yet (should I?)


Thank you!

Nikolai

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetHeapStatus.TotalAllocated

2010-02-13 Thread Vincent Snijders

Nikolai Zhubr schreef:

Hello people,

2) GetHeapStatus.TotalAllocated sometimes return negative values, though 
I haven't been able to prepare a reasonably small example yet (should I?)




Maybe that is caused by an overflow. So you need a long running example.

Vincent
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetHeapStatus.TotalAllocated

2010-02-13 Thread Nikolai Zhubr

13.02.2010 14:50, Vincent Snijders:

2) GetHeapStatus.TotalAllocated sometimes return negative values,
though I haven't been able to prepare a reasonably small example yet
(should I?)



Maybe that is caused by an overflow. So you need a long running example.


The program in question does not consume much memory and was running a 
few hours. It is multithreaded. According to task manager (this was on 
windows) actual mem usage was approximately the same as before (below 10 
Mbytes).


Nikolai



Vincent
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetHeapStatus.TotalAllocated

2010-02-13 Thread Jonas Maebe

On 13 Feb 2010, at 12:44, Nikolai Zhubr wrote:

 1) GetHeapStatus.TotalAllocated does not seem to reflect size of allocations 
 made by other threads anymore (I can provide a small example). I think such 
 behaviour is not quite correct.

The heap manager is now separate per thread so it offers much better 
performance. Keeping track of this information aggregated for all threads would 
slow things down again (even if it would be done using atomic operations).

 2) GetHeapStatus.TotalAllocated sometimes return negative values, though I 
 haven't been able to prepare a reasonably small example yet (should I?)

Yes.


Jonas___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetHeapStatus.TotalAllocated

2010-02-13 Thread Nikolai Zhubr

13.02.2010 16:33, Jonas Maebe:

The heap manager is now separate per thread so it offers much better 
performance. Keeping track of this information aggregated for all threads would 
slow things down again (even if it would be done using atomic operations).
So it is indeed not possible to obtain global status anymore? But how 
would one check global heap usage then? The necessity to collect such 
information by iterating through all threads somehow scares me... In 
particular, if some thread happens to hang or dies unexpectedly. Still, 
is there some recommended way to estimate heap usage per application, at 
least approximately?



2) GetHeapStatus.TotalAllocated sometimes return negative values, though I 
haven't been able to prepare a reasonably small example yet (should I?)

Yes.

Ok, I'll try to figure.

Thank you!

Nikolai






___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetHeapStatus.TotalAllocated

2010-02-13 Thread Jonas Maebe

On 13 Feb 2010, at 20:51, Nikolai Zhubr wrote:

 13.02.2010 16:33, Jonas Maebe:
 The heap manager is now separate per thread so it offers much better 
 performance. Keeping track of this information aggregated for all threads 
 would slow things down again (even if it would be done using atomic 
 operations).
 So it is indeed not possible to obtain global status anymore?

Not with the default heap manager.

 But how would one check global heap usage then? The necessity to collect such 
 information by iterating through all threads somehow scares me... In 
 particular, if some thread happens to hang or dies unexpectedly. Still, is 
 there some recommended way to estimate heap usage per application, at least 
 approximately?

Not without implementing a custom memory manager that does this or using some 
OS function to obtain this information.


Jonas___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetHeapStatus.TotalAllocated

2010-02-13 Thread Nikolai Zhubr

13.02.2010 22:51, Jonas Maebe:
[trim]

Not without implementing a custom memory manager that does this or using some 
OS function to obtain this information.

So even some extra InterlockedExchangeAdd would be too expensive?


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetHeapStatus.TotalAllocated

2010-02-13 Thread Jonas Maebe

On 13 Feb 2010, at 21:21, Nikolai Zhubr wrote:

 13.02.2010 22:51, Jonas Maebe:
 [trim]
 Not without implementing a custom memory manager that does this or using 
 some OS function to obtain this information.
 So even some extra InterlockedExchangeAdd would be too expensive?

It would make the memory manager slower, and I don't think that aggregating few 
statistics is a good reason to do so (especially since very few programs 
actually use that data). If you want that data, you can always install a very 
simple memory manager that simply calls through to the original one, but which 
keeps track of global statistics.


Jonas___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] fpc 14894 svn does not compile

2010-02-13 Thread ABorka

Thanks Jonas, using 2.4.0 for the 1st compile worked.
I guess I shouldn't wait months before recompiling the latest SVN :)

On 2/13/2010 02:15, Jonas Maebe wrote:


On 13 Feb 2010, at 11:10, ABorka wrote:


My ppc386.exe is v2.5.1 compiled back in September


Building FPC svn trunk has always been and will always be only supported when 
starting using the compiler the latest official release (which is 2.4.0 at this 
time).


Is there a place when I can download the newer binary files/utils needed for 
the compile if that is the problem?


You can download the latest release from the website.


Jonas___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] fpc 14894 svn does not compile

2010-02-13 Thread Jonas Maebe

On 13 Feb 2010, at 21:48, ABorka wrote:

 Thanks Jonas, using 2.4.0 for the 1st compile worked.
 I guess I shouldn't wait months before recompiling the latest SVN :)

Even if you subsequently recompile every new svn revision it may sometimes 
suddenly not work anymore with your previously compiled svn trunk version. As 
mentioned before: only compiling using the latest release is guaranteed to work 
at all times!


Jonas___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] fpc 14894 svn does not compile

2010-02-13 Thread Marco van de Voort
In our previous episode, Jonas Maebe said:
  Thanks Jonas, using 2.4.0 for the 1st compile worked.
  I guess I shouldn't wait months before recompiling the latest SVN :)
 
 Even if you subsequently recompile every new svn revision it may sometimes 
 suddenly not work anymore with your previously compiled svn trunk version. As 
 mentioned before: only compiling using the latest release is guaranteed to 
 work at all times!

I added linux/i386 and /x86_64 compilers to bootstrap:

ftp://freepascal.stack.nl/pub/fpc/dist/2.4.0/bootstrap/

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetHeapStatus.TotalAllocated

2010-02-13 Thread Nikolai Zhubr

13.02.2010 16:33, Jonas Maebe:
[...]

The heap manager is now separate per thread so it offers much better 
performance.
Wait a minute. Is it then still legal for any thread to dispose heap 
blocks allocated by another thread?


Nikolai


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetHeapStatus.TotalAllocated

2010-02-13 Thread Jonas Maebe

On 13 Feb 2010, at 22:22, Nikolai Zhubr wrote:

 13.02.2010 16:33, Jonas Maebe:
 [...]
 The heap manager is now separate per thread so it offers much better 
 performance.
 Wait a minute. Is it then still legal for any thread to dispose heap blocks 
 allocated by another thread?

Yes, that's taken care of behind the scenes.


Jonas___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetHeapStatus.TotalAllocated

2010-02-13 Thread Nikolai Zhubr

14.02.2010 0:30, Jonas Maebe:

The heap manager is now separate per thread so it offers much better 
performance.

Wait a minute. Is it then still legal for any thread to dispose heap blocks 
allocated by another thread?


Yes, that's taken care of behind the scenes.

Ok. That is good.
Now, I'm starting to suspect that negative TotalAllocated values just 
result from doing deallocations in a different thread, which is what my 
programm actually does all the time. I'll go to make a small test.


Nikolai




Jonas___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] RFC: changing conditional compilation

2010-02-13 Thread Flávio Etrusco
 Hi Jonas,
 As you can imagine I'd prefer to solve the $ifdef problem ;-)

 To be honest: no, I can't imagine why you would prefer that. The entire
 difference between $ifdef and $if is that $if checks the value of something
 (and hence will give an error if the symbol is undefined) and $ifdef checks
 whether it is defined or not. As far as I can tell, you would simply like to
 be able to use boolean constants in $if expressions.


Hope you rethink your opinion the next time you forget to add an {$I}
or mess up a define name ;-)

Best regards,
Flávio
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetHeapStatus.TotalAllocated

2010-02-13 Thread Micha Nelissen

Nikolai Zhubr wrote:
Now, I'm starting to suspect that negative TotalAllocated values just 
result from doing deallocations in a different thread, which is what my 
programm actually does all the time. I'll go to make a small test.


Maybe it's related to (or the same as) bug 14315?

http://bugs.freepascal.org/view.php?id=14315

Micha
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Re: GetHeapStatus.TotalAllocated

2010-02-13 Thread Seth Grover
As for the negative numbers (possible overflow) from the heap status,
I logged a bug on that, with an example program, quite some time ago.

http://bugs.freepascal.org/view.php?id=14315

-SG

--
This email is fiction. Any resemblance to actual events
or persons living or dead is purely coincidental.

Seth Grover
sethdgrover[at]gmail[dot]com
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel