18#include "fasp_functs.h"
27void* nedcalloc(
size_t no,
size_t size);
28void* nedrealloc(
void* mem,
size_t size);
29void nedfree(
void* mem);
71 printf(
"### DEBUG: Trying to allocate %.3lfMB RAM!\n", (
REAL)tsize /
Million);
77 mem = dlcalloc(size, type);
79 mem = nedcalloc(size, type);
81 mem = calloc(size, type);
91 printf(
"### WARNING: Trying to allocate %lldB RAM...\n", tsize);
92 printf(
"### WARNING: Cannot allocate %.4fMB RAM!\n", (
REAL)tsize /
Million);
118 printf(
"### DEBUG: Trying to allocate %.3lfMB RAM!\n", (
REAL)tsize /
Million);
124 mem = dlrealloc(oldmem, tsize);
126 mem = nedrealloc(oldmem, tsize);
128 mem = realloc(oldmem, tsize);
133 printf(
"### WARNING: Trying to allocate %lldB RAM!\n", tsize);
134 printf(
"### WARNING: Cannot allocate %.3lfMB RAM!\n", (
REAL)tsize /
Million);
170 printf(
"### WARNING: Trying to free an empty pointer!\n");
186 printf(
"### DEBUG: Number of alloc = %ld, allocated memory = %.3fMB.\n",
205 const INT memneed = 2 * iludata->
row;
207 if (iludata->
nwork >= memneed) {
210 printf(
"### ERROR: ILU needs %d RAM, only %d available!\n", memneed,
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