Page 35 of the OS Memory Management document says:

"The version 2.0 memory manager abandoned this approach, increasing the
availability of contiguous heap space; however, it still limited the maxi-mum
size of individual heaps to 64 KB each."

Does that mean that a single *application* is limited to 64 KB of heap space,
or only that an individual chunk may not exceed 64 KB?

The code snippet below fails when Type=4 if each chunk that it allocates is
about 7500 bytes.  That is, it fails after 4 chunks of 7500 bytes each are
allocated.  I assume that this means that, taken together with my other
allocations, I have exceeded the 64 KB limit for my application.  Does that
sound right?

Also, this should not fail on a Palm III, right?

Thanks,

    for (int Type=0; Type<NUMDESCRIPTYPES; ++Type)
    {
       if (m_pDescriptors[Type])
           MemPtrFree(m_pDescriptors[Type]);

        // We allocate more space than necessary, then resize it later
        m_pDescriptors[Type] = (CDescriptor *) MemPtrNew((1+NumRecords) *
sizeof(CDescriptor));     // 1+ to avoid zero length allocation
        if (!m_pDescriptors[Type])
        {
            FrmAlert(OutOfMemoryAlert);
            return(RC_OUTOFMEMORY);
        }

        m_NumDescriptors[Type]=0;
    }


- Alan Macy
  http://www.ResponsiveSoftware.com
  Time and Billing for Consultants and Others
  

Reply via email to