MA_get_pointer - get the base pointer for a block
Boolean MA_get_pointer(memhandle, pointer)
Integer memhandle; /* read-only */
Pointer *pointer; /* write-only */
MA_get_pointer() returns in pointer the base pointer for the
block corresponding to the handle memhandle (which was
returned by MA_allocate_heap() or MA_push_stack() when the
block was allocated).
The following C code illustrates the use of MA_get_pointer()
by allocating a block of 5 integers on the heap and then
storing values into the integers.
ok = MA_allocate_heap(MT_INT, 5, "heap int block",
ok = MA_get_pointer(mhandle, &pointer);
for (i = 0; i < 5; i++)
*((int *)pointer + i) = 0;
invalid memhandle: %d
memhandle is not a valid handle.
invalid checksum for memhandle %d (name: '%s')
The block's computed checksum does not match its stored
checksum. This indicates that the block has been
corrupted by having its internal state overwritten.
invalid guard(s) for memhandle %d (name: '%s')
This indicates that the block has been corrupted by
being overwritten at one or both ends. The likely cause
of this is an application indexing bug.
memhandle %d (name: '%s') not in heap or stack
The block is not currently allocated in the heap or the
Other diagnostics are possible. If seen, they indicate
corruption of the internal state of MA, caused by bugs in
either MA or the application.
C: MA_TRUE upon success, MA_FALSE upon failure.
FORTRAN: Not available.
MA_get_pointer() is not available in FORTRAN, because
FORTRAN does not support pointers.
MA(3), MA_alloc_get(3), MA_allocate_heap(3),
MA_get_index(3), MA_push_get(3), MA_push_stack(3)
Gregory S. Thomas, Pacific Northwest Laboratory