關鍵是我必須在一個文件中進行操作(用二分法查找所需資料).將多個資源合併後,所佔內存塊又將超過64K,如何解決?請注意下面這段話:
Note that chunks range in size from byte to slightly less than 64KB; you cannot allocate a single chunk larger than this
內存分配函數的定義:
MemPtrNew
Purpose Allocate a new nonmovable chunk in the dynamic heap.
Declared In MemoryMgr.h
Prototype MemPtr MemPtrNew (UInt32 size)
Parameters -> size The desired size of the chunk.
Result Returns pointer to the new chunk, or 0 if unsuccessful.
Comments This routine allocates a nonmovable chunk in the dynamic heap
returns a pointer to the chunk. Applications can use it when
allocating dynamic memory. Note that chunks range in size from
byte to slightly less than 64KB; you cannot allocate a single chunk
larger than this.
In Palm OS 3.5, the dynamic heap is sized based on the amount
memory available, and is generally larger than before.