[Lazarus] Heap usage

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Sat Jul 17 00:51:02 CEST 2010


It seems that i have counted on success too earlier.

Although the behavior of IDE is correct, i am having memory allocation 
issues when using only the added TFields.
I created a small test program with a BufDataset, Datasource, DBGrid and a 
Button. Button calls bufdataset Createdataset, Open, Append. Until here all 
looks good. The fields appear in the grid.
When try to edit, garbage appears in each field, until a SIGSEV is issued.

So, probably TBufDataset are not allocating memory to TFields as it do to 
TFieldsDef.
How or where to look for this problem.

Thanks in advance.

Marcelo



Joost van der Sluis joost at cnoc.nl
Fri Jul 16 10:41:46 CEST 2010

On Thu, 2010-07-15 at 21:55 -0300, Marcelo B de Paula wrote:
> It is late now, but i was looking in newfield.pas to learn how TFields was
> created.
>
> So, i made the necessary modifications to include the creation of field 
> type
> Data, that was missing.
>
> Tested and it worked perfectly. Using with TBufDataSet now i can create
> usable fields.
>
> If you are interested, i submitted the bugreport #16941 with a patch to
> improve this form.
>
> I am looking forward for the remaining solutions :
>  - TBufDataSet published events,
>  - Option to "create dataset" in design time.

Well, there's nothing that prohibits to create a dataset at design time.
The only missing thing is a button which does this. So maybe you could
add that too? (Or you could try to find out how to add this to the
popup-menu you get when using the second mouse-button)

Then I'll publish the events.

Joost.






More information about the Lazarus mailing list