18#include "fasp_functs.h"
27 void * nedcalloc(
size_t no,
size_t size);
28 void * nedrealloc(
void *mem,
size_t size);
29 void nedfree(
void *mem);
66 const unsigned int type)
72 printf(
"### DEBUG: Trying to allocate %.3lfMB RAM!\n", (
REAL)tsize/
Million);
78 mem = dlcalloc(size,type);
80 mem = nedcalloc(size,type);
82 mem = calloc(size,type);
92 printf(
"### WARNING: Trying to allocate %lldB RAM...\n", tsize);
93 printf(
"### WARNING: Cannot allocate %.4fMB RAM!\n", (
REAL)tsize/
Million);
120 printf(
"### DEBUG: Trying to allocate %.3lfMB RAM!\n", (
REAL)tsize/
Million);
126 mem = dlrealloc(oldmem,tsize);
128 mem = nedrealloc(oldmem,tsize);
130 mem = realloc(oldmem,tsize);
136 printf(
"### WARNING: Trying to allocate %lldB RAM!\n", tsize);
137 printf(
"### WARNING: Cannot allocate %.3lfMB RAM!\n", (
REAL)tsize/
Million);
172 printf(
"### WARNING: Trying to free an empty pointer!\n");
188 printf(
"### DEBUG: Number of alloc = %ld, allocated memory = %.3fMB.\n",
207 const INT memneed = 2*iludata->
row;
209 if ( iludata->
nwork >= memneed ) {
213 printf(
"### ERROR: ILU needs %d RAM, only %d available!\n",
214 memneed, iludata->
nwork);
void fasp_mem_free(void *mem)
Free up previous allocated memory body and set pointer to NULL.
void fasp_mem_usage(void)
Show total allocated memory currently.
SHORT fasp_mem_iludata_check(const ILU_data *iludata)
Check wether a ILU_data has enough work space.
void * fasp_mem_realloc(void *oldmem, const LONGLONG tsize)
Reallocate, initiate, and check memory.
void * fasp_mem_calloc(const unsigned int size, const unsigned int type)
Allocate, initiate, and check memory.
unsigned long total_alloc_mem
unsigned long total_alloc_count
Main header file for the FASP project.
#define SHORT
FASP integer and floating point numbers.
#define FASP_SUCCESS
Definition of return status and error messages.
INT row
row number of matrix LU, m