Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2004-09

heaptrc

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marcel Martin

Hello,

I am using fpc 1.9.5 (2004/09/15).

There is a problem with the unit heaptrc and the routine Reallocmem. For instance

  var p : PLongword;
  Reallocmem(p,1000*4);
  ...
  Reallocmem(p,200*4); <- this instruction upset heaptrc

Does the problem come from Reallocmem or from the heaptrc unit?

Thanks,

mm http://www.ellipsa.net/ ( suppress no.sp.am. )

Reply by email

Vincent Snijders
to Marcel Martin
Marcel Martin wrote 14 lines
Hello, I am using fpc 1.9.5 (2004/09/15). There is a problem with the unit heaptrc and the routine Reallocmem. For instance var p : PLongword; Reallocmem(p,1000*4); ... Reallocmem(p,200*4); <- this instruction upset heaptrc Does the problem come from Reallocmem or from the heaptrc unit?

I am having some problems with heaptrc and reallocmem too. Using your example I could reproduce it in a 3 line program (instead of lazarus).

Reallocmem moved all the data (4000 bytes in your example) to a space of size 800. Of course this is a bug. It is like likely that the old heap manager could resize memory in the same block and thus didn't need to move. Attached patch solved this issue for me. Can it be applied, or do I need to submit a bug report (with sample prog) for it too?

Regards,
Vincent.

Reply by email

Peter Vreman
to Vincent Snijders
Show quoted text 24 lines
Marcel Martin wrote: > Hello, > > I am using fpc 1.9.5 (2004/09/15). > > There is a problem with the unit heaptrc and the routine > Reallocmem. For instance > > var p : PLongword; > > Reallocmem(p,1000*4); > ... > Reallocmem(p,200*4); <- this instruction upset heaptrc > > Does the problem come from Reallocmem or from the heaptrc unit? I am having some problems with heaptrc and reallocmem too. Using your example I could reproduce it in a 3 line program (instead of lazarus). Reallocmem moved all the data (4000 bytes in your example) to a space of size 800. Of course this is a bug. It is like likely that the old heap manager could resize memory in the same block and thus didn't need to move. Attached patch solved this issue for me. Can it be applied, or do I need to submit a bug report (with sample prog) for it too?

I'll apply the fix when i'm at home

The problem is the change in TraceMemsize() to return the size stored in the information of heaptrc instead of querying SysMemsize()

Reply by email

Marcel Martin
to Vincent Snijders: I am having some problems with heaptrc and reallocmem too. Using your example I could…
Vincent Snijders wrote 23 lines
Marcel Martin wrote: > Hello, > > I am using fpc 1.9.5 (2004/09/15). > > There is a problem with the unit heaptrc and the routine > Reallocmem. For instance > > var p : PLongword; > > Reallocmem(p,1000*4); > ... > Reallocmem(p,200*4); <- this instruction upset heaptrc > > Does the problem come from Reallocmem or from the heaptrc unit? I am having some problems with heaptrc and reallocmem too. Using your example I could reproduce it in a 3 line program (instead of lazarus). Reallocmem moved all the data (4000 bytes in your example) to a space of size 800. Of course this is a bug. It is like likely that the old heap manager could resize memory in the same block and thus didn't need to move.

Thanks.

mm http://www.ellipsa.net/ ( suppress no.sp.am. )

Reply by email