next up previous 264
Next: astMalloc - Allocate memory
Up: AST Memory Management and Utility Functions
Previous: astGrow - Allocate memory for an adjustable array


astIsDynamic - Returns a flag indicating if memory was allocated dynamically

Description:
This function takes a pointer to a region of memory and tests if the memory has previously been dynamically allocated using other functions from this module. It does this by checking for the presence of a "magic" number in the header which precedes the allocated memory. If the magic number is not present (or the pointer is invalid for any other reason), zero is returned. Otherwise 1 is returned.
Synopsis:
int astIsDynamic_( const void $*$ptr )
Parameters:
ptr
Pointer to test.
Returned Value:
astIsDynamic()
Non-zero if the memory was allocated dynamically. Zero is returned if the supplied pointer is NULL.
Notes:
  • A value of zero is returned if this function is invoked with the global error status set, or if it fails for any reason.


next up previous 264
Next: astMalloc - Allocate memory
Up: AST Memory Management and Utility Functions
Previous: astGrow - Allocate memory for an adjustable array

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
R.F. Warren-Smith & D.S. Berry
25th February 2013
E-mail:starlink@jiscmail.ac.uk

Copyright (C) 2014 Science \& Technology Facilities Council