We use handles to create multiple of indices for a database. However we
always use MemHandleResize. The declaration as par the API docs is
Err MemHandleResize (VoidHandle h, ULong newSize)
As you can see h is not a pointer to a handle, there is no way the function
could change the value of h and return it. So, I assumed MemHandleResize
never changes a handle. Where as DmResizeRecord returns a handle. Chances
are there, that it will be different than the one I passed. Till now I have
not faced any problems with this scheme.
I understand this restricts us to one heap only. But, this is the best index
referrence, we could think of. Record positions need to be updated
constantly, and unique IDs involves a linear search.
On a final note, the API docs say
"On devices running version 2.0 or earlier of Palm OS � , the
MemHandleResize function tries to resize the chunk only within
the same heap, whereas DmResizeRecord will look for space in
other data heaps if it cannot find enough space in the original heap."
So, what happens in devices running version 3.0 or later of Palm OS?
-Sugho-
>From: Shannon <[EMAIL PROTECTED]>
>Reply-To: "Palm Developer Forum" <[EMAIL PROTECTED]>
>To: "Palm Developer Forum" <[EMAIL PROTECTED]>
>Subject: Can Palm comment on the future of heaps?
>Date: Wed, 15 Mar 2000 08:07:33 -0800
>
>Currently, the API specifies that whenever a storage handle gets resized,
>like through a DmResizeRecord, or a MemHandleResize, the handle might get
>relocated into a different data heap.
>
>However, since OS 3.0, there has only been one data heap, so that storage
>handles will not get moved when resized. The latest doc makes an offhand
>reference to this in the description of MemHandleResize.
>
>Can we count on this behavior in the future? In other words, will
>DmResizeRecord ALWAYS return the same handle in future OS's?
>
>It would be a huge advantage if we could count on non-moving data handles.
>One thing we could do with it is make multiple indexes into a database when
>an application starts up, and be able to count on the handles not changing
>while the application is running.
>
>Any comment from Palm?
>
>Shannon
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>Hands High Software
>Award winning software for the Palm(tm) Computing platform
>
><http://www.handshigh.com/>
>
>[EMAIL PROTECTED]
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe,
>please see http://www.palm.com/devzone/mailinglists.html
>
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html