<< Previous | Next >> | |
|
long _xalloc( long * sz, word align, word type );
Description
- Allocates memory in extended memory. If
_xalloc()
fails, a runtime error will occur.Parameters
- sz
- On entry, pointer to the number of bytes to allocate. On return, the pointed- to value will be updated with the actual number of bytes allocated. This may be larger than requested if an odd number of bytes was requested, or if some space was wasted at the end because of alignment restrictions.
- align
- Storage alignment as the log (base 2) of the desired returned memory starting address. For example, if this parameter is "8," then the returned address will align on a 256-byte boundary. Values between 0 and 16 inclusive are allowed. Any other value is treated as zero, i.e., no required alignment.
- type
- This parameter is only meaningful on boards with more than one type of RAM. For example, boards with a fast RAM and a slower battery-backed RAM like the RCM3200 or RCM3300 Use one of the following values, any other value will have undefined results.
Return value
- The 20-bit physical address of the allocated data on success. On error, a runtime error occurs.
NOTE This return value cannot be used with pointer arithmetic. Library
- STACK.LIB
Exceptions
ERR_BADXALLOC
- if could not allocate requested storage, or negative size passed.
Dynamic C Functions | << Previous | Next >> | rabbit.com |