Sign in Join

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

Mailing lists / fpc-devel / 2012-10

MemSize

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Paul Ishenin

Hello, FPC developers' list.

What should MemSize function do? Should it return the same info for statically allocated memory?

I don't see any documentation on MemSize function here: http://freepascal.org/docs-html/rtl/system/memoryfunctions.html

So I decided to test it since we rely on it in LCL:

var
   Data: array[0..2] of Integer;
begin
   WriteLn(MemSize(@Data[0]));
end.

Without heaptrc on 32bit windows:
4294967284
With heaptrc:
0

Best regards, Paul Ishenin.

Reply by email

Jonas Maebe
to Paul Ishenin
Paul Ishenin wrote
What should MemSize function do? Should it return the same info for statically allocated memory?

For statically allocated memory it will work just as badly as freemem and reallocmem.

Jonas

Reply by email