ScaLAPACK  2.0.2
ScaLAPACK: Scalable Linear Algebra PACKage
PB_Cmalloc.c File Reference
#include "../pblas.h"
#include "../PBpblas.h"
#include "../PBtools.h"
#include "../PBblacs.h"
#include "../PBblas.h"
Include dependency graph for PB_Cmalloc.c:

Go to the source code of this file.

Functions/Subroutines

char * PB_Cmalloc (int LENGTH)

Function/Subroutine Documentation

char* PB_Cmalloc ( int  LENGTH)

Definition at line 22 of file PB_Cmalloc.c.

{
/*
*  Purpose
*  =======
*
*  PB_Cmalloc allocates a dynamic memory buffer. In case of failure, the
*  program is stopped by calling Cblacs_abort.
*
*  Arguments
*  =========
*
*  LENGTH  (local input) INTEGER
*          On entry, LENGTH  specifies the length in bytes of the buffer
*          to be allocated.  If LENGTH is less or equal than zero,  this
*          function returns NULL.
*
*  -- Written on April 1, 1998 by
*     Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
*
*  ---------------------------------------------------------------------
*/
/*
*  .. Local Scalars ..
*/
   char           * bufptr = NULL;
/* ..
*  .. Executable Statements ..
*
*/
   if( LENGTH > 0 )
   {
      if( !( bufptr = (char *) malloc( (unsigned)LENGTH ) ) )
      {
         (void) fprintf( stderr, "Not enough memory on line %d of file %s!!\n",
                         __LINE__, __FILE__ );
         Cblacs_abort( -1, -1 );
      }
   }
   return( bufptr );
/*
*  End of PB_Cmalloc
*/
}

Here is the call graph for this function:

Here is the caller graph for this function: