#include "gstlearn_export.hpp"
|
#define | mem_free(tab) mem_free_(__FILE__, __LINE__, tab) |
|
#define | mem_alloc(a, b) mem_alloc_(__FILE__, __LINE__, a, b) |
|
#define | mem_calloc(a, b, c) mem_calloc_(__FILE__, __LINE__, a, b, c) |
|
#define | mem_realloc(tab, a, b) mem_realloc_(__FILE__, __LINE__, tab, a, b) |
|
#define | mem_copy(tab, a, b) mem_copy_(__FILE__, __LINE__, tab, a, b) |
|
|
GSTLEARN_EXPORT void | memory_leak_set (int flag) |
|
GSTLEARN_EXPORT void | memory_leak_reset (void) |
|
GSTLEARN_EXPORT void | memory_leak_report (void) |
|
GSTLEARN_EXPORT char * | mem_alloc_ (const char *call_file, unsigned int call_line, int size, int flag_fatal) |
|
GSTLEARN_EXPORT char * | mem_calloc_ (const char *call_file, unsigned int call_line, int size_t, int size, int flag_fatal) |
|
GSTLEARN_EXPORT char * | mem_realloc_ (const char *call_file, unsigned int call_line, char *tab, int size, int flag_fatal) |
|
GSTLEARN_EXPORT char * | mem_copy_ (const char *call_file, unsigned int call_line, char *tabin, int size, int flag_fatal) |
|
GSTLEARN_EXPORT char * | mem_free_ (const char *call_file, unsigned int call_line, char *tab) |
|
GSTLEARN_EXPORT void | mem_debug_set (int flag) |
|
GSTLEARN_EXPORT void | memory_status (const char *title) |
|
GSTLEARN_EXPORT double ** | mem_tab_free (double **tab, int nvar) |
|
GSTLEARN_EXPORT double ** | mem_tab_alloc (int nvar, int size, int flag_fatal) |
|
GSTLEARN_EXPORT unsigned long long | getTotalSystemMemory () |
|
◆ mem_alloc
#define mem_alloc |
( |
|
a, |
|
|
|
b |
|
) |
| mem_alloc_(__FILE__, __LINE__, a, b) |
◆ mem_calloc
#define mem_calloc |
( |
|
a, |
|
|
|
b, |
|
|
|
c |
|
) |
| mem_calloc_(__FILE__, __LINE__, a, b, c) |
◆ mem_copy
#define mem_copy |
( |
|
tab, |
|
|
|
a, |
|
|
|
b |
|
) |
| mem_copy_(__FILE__, __LINE__, tab, a, b) |
◆ mem_free
#define mem_free |
( |
|
tab | ) |
mem_free_(__FILE__, __LINE__, tab) |
◆ mem_realloc
#define mem_realloc |
( |
|
tab, |
|
|
|
a, |
|
|
|
b |
|
) |
| mem_realloc_(__FILE__, __LINE__, tab, a, b) |
◆ getTotalSystemMemory()
GSTLEARN_EXPORT unsigned long long getTotalSystemMemory |
( |
| ) |
|
◆ mem_alloc_()
GSTLEARN_EXPORT char* mem_alloc_ |
( |
const char * |
call_file, |
|
|
unsigned int |
call_line, |
|
|
int |
size, |
|
|
int |
flag_fatal |
|
) |
| |
Core allocation routine
- Returns
- Pointer to the array to be allocated
- Parameters
-
[in] | call_file | Name of the calling file |
[in] | call_line | Line in the calling file |
[in] | size | Number of bytes |
[in] | flag_fatal | Error status (1 = the program stops) |
◆ mem_calloc_()
GSTLEARN_EXPORT char* mem_calloc_ |
( |
const char * |
call_file, |
|
|
unsigned int |
call_line, |
|
|
int |
size, |
|
|
int |
size_elem, |
|
|
int |
flag_fatal |
|
) |
| |
Core allocation routine
- Returns
- Pointer to the array to be allocated
- Parameters
-
[in] | call_file | Name of the calling file |
[in] | call_line | Line in the calling file |
[in] | size | Number of elements |
[in] | size_elem | Number of bytes per element |
[in] | flag_fatal | Error status (1 = the program stops) |
◆ mem_copy_()
GSTLEARN_EXPORT char* mem_copy_ |
( |
const char * |
call_file, |
|
|
unsigned int |
call_line, |
|
|
char * |
tabin, |
|
|
int |
size, |
|
|
int |
flag_fatal |
|
) |
| |
Core routine for allocating and copying
- Returns
- Pointer to the newly allocated (and copied) array
- Parameters
-
[in] | call_file | Name of the calling file |
[in] | call_line | Line in the calling file |
[in] | tabin | Array to be copied |
[in] | size | Number of bytes |
[in] | flag_fatal | Error status (1 = the program stops) |
◆ mem_debug_set()
GSTLEARN_EXPORT void mem_debug_set |
( |
int |
flag | ) |
|
Set the status of the memory
- Parameters
-
◆ mem_free_()
GSTLEARN_EXPORT char* mem_free_ |
( |
const char * |
call_file, |
|
|
unsigned int |
call_line, |
|
|
char * |
tab |
|
) |
| |
Core deallocation
- Returns
- Pointer to the freed array
- Parameters
-
[in] | call_file | Name of the calling file |
[in] | call_line | Line in the calling file |
[in] | tab | Array to be freed |
◆ mem_realloc_()
GSTLEARN_EXPORT char* mem_realloc_ |
( |
const char * |
call_file, |
|
|
unsigned int |
call_line, |
|
|
char * |
tab, |
|
|
int |
size, |
|
|
int |
flag_fatal |
|
) |
| |
Core re-allocation routine
- Returns
- Pointer to the array to be re_allocated
- Parameters
-
[in] | call_file | Name of the calling file |
[in] | call_line | Line in the calling file |
[in] | tab | Array to be reallocated |
[in] | size | New number of bytes |
[in] | flag_fatal | Error status (1 = the program stops) |
◆ mem_tab_alloc()
GSTLEARN_EXPORT double** mem_tab_alloc |
( |
int |
nvar, |
|
|
int |
size, |
|
|
int |
flag_fatal |
|
) |
| |
Core allocation of an array of double
- Returns
- Pointer to the array of pointers to be allocated
- Parameters
-
[in] | nvar | number of elements in the array |
[in] | size | number of double values |
[in] | flag_fatal | error status (1 = the program stops) |
◆ mem_tab_free()
GSTLEARN_EXPORT double** mem_tab_free |
( |
double ** |
tab, |
|
|
int |
nvar |
|
) |
| |
Core deallocation of an array of pointers
- Returns
- Pointer to the freed array
- Parameters
-
[in] | tab | array of pointers to be freed |
[in] | nvar | Number of elements in the array |
◆ memory_leak_report()
GSTLEARN_EXPORT void memory_leak_report |
( |
void |
| ) |
|
◆ memory_leak_reset()
GSTLEARN_EXPORT void memory_leak_reset |
( |
void |
| ) |
|
Reset the Memory Leak processing structure
◆ memory_leak_set()
GSTLEARN_EXPORT void memory_leak_set |
( |
int |
flag | ) |
|
Set the memory leak mechanism
- Parameters
-
◆ memory_status()
GSTLEARN_EXPORT void memory_status |
( |
const char * |
title | ) |
|
Print the status of the memory
- Parameters
-
[in] | title | Title printed when checking memory |