#include "Basic/AStringable.hpp"
#include "Basic/String.hpp"
#include "Basic/Timer.hpp"
#include "Basic/Memory.hpp"
#include "Core/Keypair.hpp"
#include <string.h>
Functions | |
void | time_start (void) |
static void | st_time_chunk_close (void) |
void | time_reset (void) |
void | time_chunk_add (const char *call_name) |
void | time_report (void) |
static void | st_mem_update (int size) |
void | memory_leak_reset (void) |
static void | st_memory_leak_add (const char *call_file, int call_line, size_t size, void *ptr) |
static void | st_memory_leak_delete (const char *call_file, unsigned int call_line, void *ptr) |
void | memory_leak_report (void) |
void | mem_debug_set (int flag) |
void | memory_leak_set (int flag) |
void | memory_status (const char *title) |
static void | st_mem_message (const char *call_file, unsigned int call_line, const char *format, int oper, int size) |
char * | mem_free_ (const char *call_file, unsigned int call_line, char *tab) |
char * | mem_alloc_ (const char *call_file, unsigned int call_line, int size, int flag_fatal) |
char * | mem_copy_ (const char *call_file, unsigned int call_line, char *tabin, int size, int flag_fatal) |
char * | mem_calloc_ (const char *call_file, unsigned int call_line, int size, int size_elem, int flag_fatal) |
char * | mem_realloc_ (const char *call_file, unsigned int call_line, char *tab, int size, int flag_fatal) |
double ** | mem_tab_free (double **tab, int nvar) |
double ** | mem_tab_alloc (int nvar, int size, int flag_fatal) |
Variables | |
static int | MEMORY_LEAK = 0 |
static int | MEMORY_DEBUG = 0 |
static int | MEMORY_TOTAL = 0 |
static int | MEMORY_MAX = 0 |
static int | MEMORY_MIN_PT = 1000000 |
static int | NB_MEM_CHUNK = 0 |
static int | NB_TIME_CHUNK = 0 |
static int | TIME_FOCUS = -1 |
static hrc::time_point | TIME_CURRENT = hrc::time_point() |
static MemChunk ** | MemLeak = NULL |
static TimeChunk ** | TimeStat = NULL |
char* mem_alloc_ | ( | const char * | call_file, |
unsigned int | call_line, | ||
int | size, | ||
int | flag_fatal | ||
) |
Core allocation routine
[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) |
char* mem_calloc_ | ( | const char * | call_file, |
unsigned int | call_line, | ||
int | size, | ||
int | size_elem, | ||
int | flag_fatal | ||
) |
Core allocation routine
[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) |
char* mem_copy_ | ( | const char * | call_file, |
unsigned int | call_line, | ||
char * | tabin, | ||
int | size, | ||
int | flag_fatal | ||
) |
Core routine for allocating and copying
[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) |
void mem_debug_set | ( | int | flag | ) |
Set the status of the memory
[in] | flag | Activiation flag |
char* mem_free_ | ( | const char * | call_file, |
unsigned int | call_line, | ||
char * | tab | ||
) |
Core deallocation
[in] | call_file | Name of the calling file |
[in] | call_line | Line in the calling file |
[in] | tab | Array to be freed |
char* mem_realloc_ | ( | const char * | call_file, |
unsigned int | call_line, | ||
char * | tab, | ||
int | size, | ||
int | flag_fatal | ||
) |
Core re-allocation routine
[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) |
double** mem_tab_alloc | ( | int | nvar, |
int | size, | ||
int | flag_fatal | ||
) |
Core allocation of an array of double
[in] | nvar | number of elements in the array |
[in] | size | number of double values |
[in] | flag_fatal | error status (1 = the program stops) |
double** mem_tab_free | ( | double ** | tab, |
int | nvar | ||
) |
Core deallocation of an array of pointers
[in] | tab | array of pointers to be freed |
[in] | nvar | Number of elements in the array |
void memory_leak_report | ( | void | ) |
Report Memory Leak
void memory_leak_reset | ( | void | ) |
Reset the Memory Leak processing structure
void memory_leak_set | ( | int | flag | ) |
Set the memory leak mechanism
[in] | flag | Activation flag |
void memory_status | ( | const char * | title | ) |
Print the status of the memory
[in] | title | Title printed when checking memory |
|
static |
Print a memory debugging message
[in] | call_file | Name of the calling file |
[in] | call_line | Line in the calling file |
[in] | format | Output format |
[in] | oper | Sign of the operation (1 for allocation; -1 for free) |
[in] | size | Number of bytes treated |
|
static |
Update the Memory management
[in] | size | Size of the allocation/deallocation |
|
static |
Add a Memory Chunk
[in] | call_file | Name of the calling file |
[in] | call_line | Line of the calling function |
[in] | size | Dimension of the Chunk |
[in] | ptr | Address of the Chunk |
|
static |
Delete a Memory Chunk
[in] | call_file | Name of the calling file |
[in] | call_line | Line in the calling file |
[in] | ptr | Address of the Chunk to be freed |
|
static |
Close the current Time Chunk
void time_chunk_add | ( | const char * | call_name | ) |
Initialize a Time Chunk
[in] | call_name | Name of the Chunk |
void time_report | ( | void | ) |
Report the Time Stats
void time_reset | ( | void | ) |
Reset the Time
void time_start | ( | void | ) |
Initialize the Timer
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |