Chi-Yi Lin wrote:

> In Palm OS Programmer's Companion, Chap 6 Memory, it says that heap
> header holds the size of the heap and contains flags for the heap. But it
> doesn't say what the flag format is. Does anyone know about the detailed
> format (the beginning 16 bits of the header) ? Or where can I get some
> more document about Palm OS?
>
> Following is the information I saw at the beginning of heap 0:
> 20 00   00 03 E8 00   00 00 06 EB 00 C8 00 00 ....
> ^^^^^   ^^^^^^^^^^^   ^^^^^^^^^^^^^^^^^^^^^^^^^^
> flag      size                master pointer table
>
> But I have no idea about the flag (2000) stands for...

The SDK files released with for OS 3.3 had a MemoryPrvNew.h file that included this:

    typedef struct {
     Word      flags;     // heap flags;
     DWord      size;      // size of heap
     DWord      firstFreeChunkOffset;// offset/2 to first free chunk
     MemMstrPtrTableType mstrPtrTbl;    // Master pointer table
     } MemHeapHeaderType;
    typedef MemHeapHeaderType*   MemHeapHeaderPtr;

    // Flags Field
    #define memHeapFlagReadOnly 0x0001  // heap is read-only (ROM based)
    #define memHeapFlagVers2  0x8000  // version 2 heap (> 64K)
    #define memHeapFlagVers3  0x4000  // version 3 heap (has free list)

Note the change.  'firstFreeChunkOffset' was added in OS 3.3.

This file is no longer a distributed header, but if I had to
guess, I'd guess that 0x2000 indicates that you have a
version 3.5 memory heap.

Is there any reason that files like MemoryPrv.h and DataPrv.h
are no longer distributed?  There's some helpful information in
them.

-- Tim



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

Reply via email to