[fpc-pascal] more questions on storage

Marc Santhoff M.Santhoff at t-online.de
Wed Sep 26 05:54:27 CEST 2007


Hi,

having this definition:


{$mode objfpc}
{$longstrings on}
type
	cmpstr = record
		ID: integer;
		Name: string;
		Value: single;
	end;

var
	buf: array [0..MAX] of cmpstr;

How does the memory layout of the buffer look like?

I tried to get there with ddd but I couln't find out how the string
inbetween is put into memory. For atomic types (integer, single) it's
pretty clear, but longstrings do have a variable size. How is the buffer
set up?

TIA,
Marc




More information about the fpc-pascal mailing list