If you lock the handle to a PDB record that contains your memory chunk for the duration that your pointer into your struct is in scope you should be OK. If you unlock the record then you would have to update your memory pointer again once you locked the record again. Should be pretty easy to keep your pointers valid as long as you manage the locking of PDB records correctly.
Hope that helps, Aaron >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of Clive Walden >Sent: Thursday, March 24, 2005 12:49 PM >To: Palm Developer Forum >Subject: Advice on persistency please > > >I am developing an app. that will store approx. 500,000 >contacts. To do this I have my own heavily normalized database >inside the Palm database (memory chunks). The data will be >almost read only. That is, there are a couple of bytes whose >value can be changed; but nothing can be added, deleted or >change in size. As the records in my main table are nothing >more than indexes into other tables, I am concerned about the >persistency of any memory pointer I retrieve. In a simplistic >example say I have a a record(mine not Palm) with Two fields >FirstNameKey (23) LastNameKey (104) If I retrieve a pointer to >my FirstNameData (e.g. PalmRecord 6 pointer + 25 byte offset) >Will that remain valid after I have done the same thing for >LastNameData and, possibly, an additional 5 contacts? > >In other words, can I retrieve the locations of the data I >want initially and write the strings to the screen direct from >memory later, when I need to, or will I have to copy the >actual string data ('John', 'Doe') into memory at the moment >that I find its location? > >Obviously the latter would use much more memory, be slower, >and require lots more memory allocation and disposal. > >I just want to make sure that I do not get bitten after the >application is deployed by something that did not show up >during testing because the memory "just happened" to stay stable. > >Thanks, >Clive >-- >For information on using the Palm Developer Forums, or to >unsubscribe, please see http://www.palmos.com/dev/support/forums/ > > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
