The functions for allocating memory to a block follow the style of
malloc
and free
. In addition they also perform their own
error checking. If there is insufficient memory available to allocate a
block then the functions call the GSL error handler (with an error
number of GSL_ENOMEM
) in addition to returning a null
pointer. Thus if you use the library error handler to abort your program
then it isn't necessary to check every alloc
.
gsl_block_calloc
if you want to ensure that all the
elements are initialized to zero.
A null pointer is returned if insufficient memory is available to create the block.
gsl_block_alloc
or gsl_block_calloc
.