> 1) Is DmFindRecordByID() fast?  Is there some index of uniqueID's, or does
> it do a linear search of all records?

The latter. It's a fast linear search - fast because it doesn't have to
dereference each record's handle.

> 2) Regarding the purpose of the record index and uniqueID... 
> Is that all correct?

Yes.

> 3) What is the memory overhead (in bytes) associated with each record?

I'm not sure exactly, but something like this... 8 bytes for the record
header (4 for the handle, 3 for the unique ID, and 1 for the record
attributes), 4 bytes for the handle's contents (a pointer), and 8 bytes for
the chunk header. If the record contents require an odd number of bytes, add
one more for padding. (All chunks start at even addresses.) If you want to
know more precisely, there's the Knowledge Base article that explains how
the Memory Manager works in detail. This has changed before and is subject
to change again.

> 4) When resizing a record, how do you move data around inside the record
> (for inserting/deleting content from the middle of the record)?  Can you
> just lock a handle inside the record and use it as the src parameter for
> DmWrite?

I'm not sure I understand this question. When you resize a record to be
larger, the contents are copied for you if the chunk has to be moved. If you
want to insert data within a record, you can us DmWrite, much as you would
MemMove, to shift the contents. Like MemMove, DmWrite is safe to use with
overlapping regions. (In fact, DmWrite just calls MemMove.)
--
Danny @ PalmSource

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to