New(bytes)
NIL is returned.
The memory is initialised to zero in each byte, and taken from any available store (Fast or Chip memory, in that order of preference).
When you've finished with this memory you can use Dispose to free it for use elsewhere in your program.
You don't have to Dispose with memory you allocated with New because your program will automatically free it when it terminates.
This is not true for memory allocated using the normal Amiga system routines.
NewR(bytes)
New except that if the memory could not be allocated then the exception "MEM" is raised (and so, in this case, the function does not return).
See 13 Exception Handling.
NewM(bytes,type)
NewR except that the type of memory (Fast or Chip) to be allocated can be specified using flags.
The flags are defined in the module `exec/memory' (see 12.2 Amiga System Modules).
See the Rom Kernel Reference Manual (Libraries) for details about the system function AllocMem which uses these flags in the same way.
As useful example, here's a small program which allocates some cleared (i.e., zeroed) Chip memory.
MODULE 'exec/memory'
PROC main()
DEF m
m:=NewM(20, MEMF_CHIP OR MEMF_CLEAR)
WriteF('Allocation succeeded, m = $\h\n', m)
EXCEPT
IF exception="NEW" THEN WriteF('Failed\n')
ENDPROC
Dispose(address)
New, NewR or NewM.
You should rarely need to use this function because the memory is automatically freed when the program terminates.
DisposeLink(complex)
String (see 9.5.2 String functions) or List (see 9.5.4 List functions).
Again, you should rarely need to use this function because the memory is automatically freed when the program terminates.
FastNew(bytes)
NewR except it uses a very fast, recycling method of allocating memory.
The memory allocated using FastNew is, as ever, deallocated automatically at the end of a program, and can be deallocated before then using FastDispose.
Note that only FastDispose can be used and that it differs slightly from the Dispose and DisposeLink functions (you have to specify the number of bytes again when deallocating).
FastDispose(address,bytes)
FastNew.
The bytes parameter must be the same as the bytes used when the memory was allocated with FastNew, but the benefit is much faster allocation and deallocation, and generally more efficient use of memory.
CleanUp(expression=0)
Exit routine which should never be used in an E program.
This is the only safe way of terminating a program, other than reaching the (logical) end of the main procedure (which is by far the most common way!).
CtrlC()
TRUE if control-C has been pressed since the last call, and FALSE otherwise.
This is really sensible only for programs started from the Shell/CLI.
FreeStack()
KickVersion(expression)
TRUE if your Kickstart revision is at least that given by expression, and FALSE otherwise.
For instance, KickVersion(37) checks whether you're running with Kickstart version 37 or greater (i.e., AmigaDOS 2.04 and above).
Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.