1 #include <../../nrnconf.h>
46 static char rcsid[] =
"meminfo.c,v 1.1 1997/12/04 17:55:37 hines Exp";
71 #define MEM_NUM_STD_TYPES (sizeof(mem_type_names)/sizeof(mem_type_names[0]))
111 int (*free_funcs[])();
117 if (type_names ==
NULL || free_funcs ==
NULL
118 || info_sum ==
NULL || ntypes < 0)
178 fprintf(
fp,
" %15s[%d]:\n",
"CONTENTS OF mem_connect",list);
181 "alloc.",
"# alloc.",
186 "bytes",
"variables",
278 fprintf(
fp,
" MEMORY INFORMATION (standard types):\n");
280 fprintf(
fp,
" MEMORY INFORMATION (list no. %d):\n",list);
290 fprintf(
fp,
" type %-7s %10ld alloc. byte%c %6d alloc. variable%c\n",
292 n, (
n!=1 ?
's' :
' '));
295 fprintf(
fp,
" %-12s %10ld alloc. byte%c %6d alloc. variable%c\n\n",
296 "total:",
t, (
t!=1 ?
's' :
' '),
297 nt, (nt!=1 ?
's' :
' '));
316 int old_size,new_size;
324 if ( type < 0 || type >= mlist->
ntypes
328 if ( old_size < 0 || new_size < 0 )
334 if ( old_size > 0 ) {
339 "\n WARNING !! memory info: allocated memory is less than 0\n");
342 if ( !isatty(fileno(stdout)) ) {
344 "\n WARNING !! memory info: allocated memory is less than 0\n");
370 if ( type < 0 || type >= mlist->
ntypes
382 "\n WARNING !! memory info: allocated # of variables is less than 0\n");
384 if ( !isatty(fileno(stdout)) ) {
386 "\n WARNING !! memory info: allocated # of variables is less than 0\n");
#define error(err_num, fn_name)
long mem_info_bytes(int type, int list)
static MEM_ARRAY mem_info_sum[MEM_NUM_STD_TYPES]
#define MEM_NUM_STD_TYPES
int mem_info_numvar(int type, int list)
static int mem_switched_on
int mem_is_list_attached(int list)
void mem_dump_list(FILE *fp, int list)
void mem_info_file(FILE *fp, int list)
void mem_numvar_list(int type, int num, int list)
int mem_attach_list(int list, int ntypes, type_names, int(*[] free_funcs)(), info_sum)
static int(* mem_free_funcs[MEM_NUM_STD_TYPES])()
MEM_CONNECT mem_connect[MEM_CONNECT_MAX_LISTS]
int mem_free_vars(int list)
void mem_bytes_list(int type, int old_size, int new_size, int list)
static char * mem_type_names[]
#define MEM_CONNECT_MAX_LISTS
#define MEM_SWITCH_ON_DEF
int const size_t const size_t n