src/tio_malloc.c
/***************************************************************************************************
 *
 * iTIO_MemStats
 *
 * Simple routine to return a few memory stats
 * Obtains the last memory request to malloc/realloc
 * Also sums the current accounted memory
 *
 **************************************************************************************************/
iTIO_MemStats
Simple routine to return a few memory stats
Obtains the last memory request to malloc/realloc
Also sums the current accounted memory
iTIO_MemStats Simple routine to return a few memory stats Obtains the last memory request to malloc / realloc Also sums the current accounted memory
int iTIO_MemStats(size_t *current, size_t *requested)
{
  size_t total = 0;
  size_t i;
  *current   = 0;
  *requested = 0;
#if defined (_TYPHIO_MEMORY_DEBUG) || defined (_TYPHIO_MEMORY_STATS)
  for (i=0; i<heap_count; ++i) {
    if (heap_list[i].p != NULL) {
      total += heap_list[i].size;
    }
  }
  *current   = total;
  *requested = last_requested;
  return (0);
#endif
  return (-1);
}
int iTIO_MemStats ( size_t * current , size_t * requested ) { size_t total = 0 ; size_t i ; * current = 0 ; * requested = 0 ; #if defined ( _TYPHIO_MEMORY_DEBUG ) || defined ( _TYPHIO_MEMORY_STATS ) for ( i = 0 ; i < heap_count ; ++ i ) { if ( heap_list [ i ] . p != NULL ) { total += heap_list [ i ] . size ; } } * current = total ; * requested = last_requested ; return ( 0 ) ; #endif return ( -1 ) ; }
iTIO_MemStats
 Simple routine to return a few memory stats
 Obtains the last memory request to malloc/realloc
 Also sums the current accounted memory
iTIO_MemStats Simple routine to return a few memory stats Obtains the last memory request to malloc / realloc Also sums the current accounted memory