| M E M _ S E T V E C P O O L E D ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English
AMIGA - MEM_#?
----------------------------------------------------------------------------
NAME
mem_setvecpooled() - Set/get allocation params per proc.
SYNOPSIS
parm = mem_setvecpooled(memtype, item, value);
LONG mem_setvecpooled(ULONG, ULONG, LONG);
FUNCTION
This function allows to set or get memory params out of
internal pool nodes. There are two nodes, the 'chip' and
'fast' node. They are maintained per process.
INPUTS
memtype - MEMF_CHIP or MEMF_FAST(and its brothers).
item - Item to set or request, see header file for
available items.
value - Value to set in place or -1 to just get it.
RETURNS
Returns old value or -1 upon error.
BASES
SysBase
NOTES
Currenty this function can only set two params and these
are: puddle size and treshold. See Commodore-Amiga 'RKM'
for more info on those. Anyway, these values can only
be set if no calls to 'mem_allocvecpooled()' were made!
See 'a-mem_xxxvecpooled.c' for the default pool values.
At any time you may request info about: real amount of
memory allocated, total amount of memory allocated,
number of all memory allocations, pool pointer addr. as
an integer and/or free the pools at once, see defines.
SEE ALSO
mem_allocvecpooled(), mem_freevecpooled()
EXAMPLE
#include <proto/exec.h>
#include <exec/memory.h>
#include <proto/dos.h>
/*
* 'AllocVec()'/'FreeVec()' pair will be turned into
* 'mem_allocvecpooled()'/'mem_freevecpooled()' pair.
*/
#define ___QDEV_FORCEPOOLS
#include <qdev.h>
...
UBYTE *ptr;
if (QDEV_MEM_XXXVPINIT(MEMF_FAST, 32768, 32768))
{
if ((ptr = AllocVec(4096, MEMF_FAST | MEMF_CLEAR)))
{
FPrintf(Output(), "%ld bytes of memory is now"
" allocated\n",
mem_setvecpooled(MEMF_FAST,
QDEV_MEM_XXXVPI_REAL,
QDEV_MEM_XXXVPV_NOCH));
FreeVec(ptr);
}
}
BUGS
None known.
----------------------------------------------------------------------------
| |
| |