Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Before allocating memory, the application has to know in which bank the requested memory area is located. OS_Fma provides that job with plenty of options. An even bank number can be requested since segment 0 can only be allocated with such banks. Remember that if an odd RAM bank is bound to segment 0, the upper half of the previous even bank will be bound to $2000-$3FFF (an even bank number is bound to $2000-$3FFF with lower half of that bank). A fixed memory (not subject to swapping) can be requested, this is useful if your application is not a popdown and does not release this memory when suspended. An explicit slot can be specified or any of them letting routine scan all slots for requested memory. If successful, the bank number is returned in B. Offset address can be automatically generated by OS_Fma with the FM_NOF option. This feature is often used when memory offset does not matter like data storage, buffers or relocatable code.

 

Allocating memory

Memory allocation is provided by OS_Axp or OS_Axm following an OS_Mop. During opening, memory allocations flags are set for all the session : MM_MUL, MM_FIX... OS_Mop returns a memory handle which will be mandatory for all further allocation calls.

...