[fpc-pascal] more questions on storage
Marc Santhoff
M.Santhoff at t-online.de
Wed Sep 26 11:18:12 CEST 2007
Am Mittwoch, den 26.09.2007, 09:30 +0200 schrieb Michael Van Canneyt:
>
> On Wed, 26 Sep 2007, Marc Santhoff wrote:
>
> > 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?
>
> Longstrings are not working correctly. You should use ansistrings or
> shortstrings.
Okay, good to know. Besides I'm using fpc 2.0.4, what is it that's not
working?
And back to the original question: how is the memory layout using
AnsiString then?
Thanks,
Marc
More information about the fpc-pascal
mailing list