| M E M _ A L L O C C L U S T E R ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English PORTA - MEM_#?
----------------------------------------------------------------------------
NAME
mem_alloccluster() - Allocate memory for the cluster.
SYNOPSIS
ptr = mem_alloccluster(size, chunks, flags);
void *mem_alloccluster(ULONG, ULONG, ULONG);
FUNCTION
This func. allocates memory for the cluster of equally
sized chunks.
INPUTS
size - Size of one chunk.
chunks - How many chunks.
flags - Memory flags. Oring('|') MEMF_LARGEST will
allow clusters to be linked, which means that
if this cluster becomes empty new one will be
allocated and linked in.
RETURNS
Returns ptr to newly created cluster or NULL if there
is not enough memory.
BASES
SysBase
NOTES
Please note that you will need to sacrifice 4 bytes per
chunk, which can be quite a memory for big clusters...
Always LONG align structures that will be then granted
that memory if you need to BPTRize them!
Cluster can be shared across tasks or processes with no
problems.
Currently there is no way to track in-cluster allocs
with common debug tools.
Keep in mind that MEMF_CLEAR is only valid for chunks
that were obtained for a first time. Releasing them and
obtaining once again does not clear the memory!
SEE ALSO
mem_freecluster(), mem_getmemcluster(),
mem_freememcluster()
EXAMPLE
None.
BUGS
None known.
----------------------------------------------------------------------------
| |
| |