Contents | Index | < Browse | Browse >
usage: ALLOCMEM(length,[attribute])

-Allocates specified size block of memory from the system free-memory pool
and returns its address as a 4-byte string
-The optional attribute parameter must be a standard EXEC memory allocation
flag, supplied as a 4-byte string. The default attribute is for "PUBLIC"
memory (not cleared). The ROM kernel manuals for information on memory
types and attribute parameters
-This function should be used whenever memory is allocated for use by
external programs. The user is responsible to release memory no longer
needed. The following list taken from "Advanced Amiga Basic" may give some
direction:
"AllocMem() lets you choose what kind of memory you get by forming a
flag value. The flag value is the sum of the bit values for the desired
combination of memory types. Usually, you'll just want to get a chunk of
memory and don't care what you get. For this, use a value of zero... Public
memory (type 1) is assumed to be used by many different routines, so the
system memory manager is not allowed to relocate it...Here is a list of
symbolic names and values used with AllocMem() to choose other kinds of
memory:
MEMF_PUBLIC 1 Stable, non-relocatable memory area
MEMF_CHIP 2 Chip memory
MEMF_FAST 4 Fast memory
MEMF_CLEAR 65536 Memory area is cleared"
-see also Freemem()