[fpc-pascal] question about FPC heap and threading

Michael Van Canneyt michael at freepascal.org
Thu Aug 12 23:13:29 CEST 2010



On Thu, 12 Aug 2010, Mark Morgan Lloyd wrote:

> Seth Grover wrote:
>> These are very simple questions, but I just want to make sure a few of
>> my assumptions are correct:
>> 
>> 1. The default FPC heap manager uses one heap per thread, right? I am
>> basing this assumption off of things I have read in various threads on
>> this and other mailing lists since around 2.2.x-ish. Looking at
>> heap.inc I see that the "freelists" variable is a threadvar, which
>> indicates to me that each thread has its own heap.
>
> If that's the case and also applies to Lazarus it's going to save me a lot of 
> effort, so I'd be interested to see this confirmed as well.

FPC uses one heap per thread. If lazarus doesn't install it's own heap manager, 
it is true for Lazarus as well.

Michael.



More information about the fpc-pascal mailing list