Eric writes:
> I wonder if you can help me out. Is there an intrinsic available from C
> for determining the total physical memory size of a machine?
AIFSCGET, item #3039 returns the amount of physical memory in units
of 2048 byte pages (not 4096 byte pages, BTW).
You used to have to purchase the AIF:OS manual to find the calling
sequence/information for this intrinsic.
Other techniques exist, certainly.
For example:
extern void get_memsize (uint32 *num_2kpages); /* internal OS routine */
int32 get_memsize_mbs () /* returns # of megabytes of memory */
{
uint32 /* *everyone* uses int32/uint32, don't they?! */
num_2kpages = 0;
GETPRIVMODE (); /* get_memsize requires priv mode */
get_memsize (&num_2kpages);
return (num_2kpages / 512); /* return # of megabytes, rounded down */
}
Prep program with CAP=PM.
--
Stan Sieler [log in to unmask]http://www.allegro.com/sieler.html