[fpc-devel] [Fwd: TMemDataset : pb & suggestions]
Florian Klaempfl
florian at freepascal.org
Fri Oct 6 19:08:48 CEST 2006
Redirected to fpc-devel for a larger audience.
-------- Original-Nachricht --------
Betreff: TMemDataset : pb & suggestions
Datum: Fri, 06 Oct 2006 11:34:51 +0200
Von: Oro06 <orinaudo at gmail.com>
Antwort an: core at freepascal.org
An: core <core at freepascal.org>
Hi,
i'm trying to use TMemDataset on arm/wince and
actually getting bus error/alignement issue.
1°) pb
in short :
all records are stored in a big memory stream
each record is accessed using base address+offset(multiple of RecSize
where RecSize is the sum of all fields size)
then each field is also accessed using base record address+field offset
finally accessing datas give something like this :
pChar(Buffer+MDSGetFieldOffset(I))^
and this give alignement errors
is there a proper way to make it mode cpu portable ?
2°)missing feature :
-this architecure can't handle blob/strings with unfixed length
(with sqlight datasets, length for string fields is 0)
-as indicated in sources, record delete is unefficient as it duplicate
the full stream (see line 364 memds.pp)
3°)proposed changes
a-use of an internal TList or TLockList to navigate between records
b-handle a second internal 'aligned size' longint for each fields
used for storing datas in memory with internalalignedsize=usersize+some
alignement unused bytes
c-strings are no more stored directly in the record buffer but allocated
in the heap and only a pointer to it
is stored in record buffer
d-add of blob handling with same rule as strings
->i don't see maintener on snv log for this unit so i'm about to do that
and of course
any comments regarding this and/or multicpu best practice appreciated
regards
or
re
More information about the fpc-devel
mailing list