ncdf4a13/libsrc/onstack.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ALLOC_ONSTACK(name, type, nelems)   type *const name = (type *) malloc((nelems) * sizeof(type))
#define FREE_ONSTACK(name)   free(name)


Define Documentation

#define ALLOC_ONSTACK name,
type,
nelems   )     type *const name = (type *) malloc((nelems) * sizeof(type))
 

This file provides definitions which allow us to "allocate" arrays on the stack where possible. (Where not possible, malloc and free are used.)

The macro ALLOC_ONSTACK(name, type, nelems) is used to declare an array of 'type' named 'name' which is 'nelems' long. FREE_ONSTACK(name) is placed at the end of the scope of 'name' to call 'free' if necessary.

The macro ALLOC_ONSTACK wraps a call to alloca() on most systems.

Definition at line 64 of file onstack.h.

Referenced by nc_copy_var(), nc_get_var_double(), nc_get_var_float(), nc_get_var_int(), nc_get_var_long(), nc_get_var_schar(), nc_get_var_short(), nc_get_var_text(), nc_get_var_uchar(), nc_get_vara_double(), nc_get_vara_float(), nc_get_vara_int(), nc_get_vara_long(), nc_get_vara_schar(), nc_get_vara_short(), nc_get_vara_text(), nc_get_vara_uchar(), nc_put_var_double(), nc_put_var_float(), nc_put_var_int(), nc_put_var_long(), nc_put_var_schar(), nc_put_var_short(), nc_put_var_text(), nc_put_var_uchar(), nc_put_vara_double(), nc_put_vara_float(), nc_put_vara_int(), nc_put_vara_long(), nc_put_vara_schar(), nc_put_vara_short(), nc_put_vara_text(), and nc_put_vara_uchar().

#define FREE_ONSTACK name   )     free(name)
 

Definition at line 67 of file onstack.h.

Referenced by nc_copy_var(), nc_get_var_double(), nc_get_var_float(), nc_get_var_int(), nc_get_var_long(), nc_get_var_schar(), nc_get_var_short(), nc_get_var_text(), nc_get_var_uchar(), nc_get_vara_double(), nc_get_vara_float(), nc_get_vara_int(), nc_get_vara_long(), nc_get_vara_schar(), nc_get_vara_short(), nc_get_vara_text(), nc_get_vara_uchar(), nc_put_var_double(), nc_put_var_float(), nc_put_var_int(), nc_put_var_long(), nc_put_var_schar(), nc_put_var_short(), nc_put_var_text(), nc_put_var_uchar(), nc_put_vara_double(), nc_put_vara_float(), nc_put_vara_int(), nc_put_vara_long(), nc_put_vara_schar(), nc_put_vara_short(), nc_put_vara_text(), and nc_put_vara_uchar().


Generated on Thu Mar 16 18:11:11 2006 for nco by  doxygen 1.4.4