OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
PB_Cmalloc.c File Reference
#include "../pblas.h"
#include "../PBpblas.h"
#include "../PBtools.h"
#include "../PBblacs.h"
#include "../PBblas.h"

Go to the source code of this file.

Functions

char * PB_Cmalloc (Int LENGTH)

Function Documentation

◆ PB_Cmalloc()

char * PB_Cmalloc ( Int LENGTH)

Definition at line 22 of file PB_Cmalloc.c.

28{
29/*
30* Purpose
31* =======
32*
33* PB_Cmalloc allocates a dynamic memory buffer. In case of failure, the
34* program is stopped by calling Cblacs_abort.
35*
36* Arguments
37* =========
38*
39* LENGTH (local input) INTEGER
40* On entry, LENGTH specifies the length in bytes of the buffer
41* to be allocated. If LENGTH is less or equal than zero, this
42* function returns NULL.
43*
44* -- Written on April 1, 1998 by
45* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
46*
47* ---------------------------------------------------------------------
48*/
49/*
50* .. Local Scalars ..
51*/
52 char * bufptr = NULL;
53/* ..
54* .. Executable Statements ..
55*
56*/
57 if( LENGTH > 0 )
58 {
59 if( !( bufptr = (char *) malloc( (unsigned)LENGTH ) ) )
60 {
61 (void) fprintf( stderr, "Not enough memory on line %d of file %s!!\n",
62 __LINE__, __FILE__ );
63 Cblacs_abort( -1, -1 );
64 }
65 }
66 return( bufptr );
67/*
68* End of PB_Cmalloc
69*/
70}
void Cblacs_abort()