[fpc-devel] Heaptrc settings by environments
Martin Frb
lazarus at mfriebe.de
Tue Apr 22 18:50:44 CEST 2014
On 22/04/2014 08:12, Michael Van Canneyt wrote:
> On Mon, 21 Apr 2014, Martin Frb wrote:
>> About:
>> tracesize = 8;
>>
>> This is currently used in type definition
>> theap_mem_info = record
>> calls : array [1..tracesize] of codepointer;
>>
>> So it can not be changed at runtime.
>>
>> Without any intend of immediate action, but curiosity for future
>> potential patches, would it be considered acceptable, if:
>> - The array was moved to the end of record, and defined
>> calls : array [1..8] of codepointer;
>
> I would make this array[1..1] of codepointer.
Was my first thought.
Then I reflected that the record should be dividable by 8 bytes. Though
I overdone it, 1..2 (for 32 bit) would do that.)
Of course not really needed either, since the memory boundary will
anyway be adjusted when the variable length is added.
>
>> But (without range check) would allow arbitrary indexes
>> - All memory alloc would replace "sizeof(theap_mem_info)" by
>> "sizeof(theap_mem_info)+(tracesize-8)*sizeof(codepointer)" (can be
>> pre calculated)
>> - checks where in place to ensure it is divide-able by 8 / minimum of 8
>> - all resulting errors and problems (potentially a great many) would
>> be fixed.
>>
>> Allowing to make the value configurable.
>
> I want this feature since a long time since the default is
> ridiculously small.
> I didn't think of putting it at the end of the block, and this could
> indeed work.
:)
More information about the fpc-devel
mailing list