2003-01-20 05:58:50 +08:00
|
|
|
/*
|
|
|
|
Copyright (C) 2002 FPMD group
|
|
|
|
This file is distributed under the terms of the
|
|
|
|
GNU General Public License. See the file `License'
|
|
|
|
in the root directory of the present distribution,
|
|
|
|
or http://www.gnu.org/copyleft/gpl.txt .
|
|
|
|
*/
|
|
|
|
|
2004-06-26 01:25:37 +08:00
|
|
|
#include "c_defs.h"
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2006-06-26 15:50:31 +08:00
|
|
|
/*
|
|
|
|
This function return the numer of kilobytes allocated
|
|
|
|
by the calling process.
|
|
|
|
Auhor: Carlo Cavazzoni.
|
|
|
|
*/
|
|
|
|
|
2008-11-04 19:04:30 +08:00
|
|
|
#if defined (__SVR4) && defined (__sun)
|
|
|
|
#define SUN_MALLINFO
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_MALLINFO) && !defined(__QK_USER__) && !defined(SUN__MALLINFO)
|
2006-09-13 00:17:24 +08:00
|
|
|
#include <malloc.h>
|
2009-10-11 00:36:49 +08:00
|
|
|
|
|
|
|
void F77_FUNC(memstat,MEMSTAT)(int *kilobytes)
|
|
|
|
{
|
|
|
|
|
2006-06-26 15:50:31 +08:00
|
|
|
struct mallinfo info;
|
|
|
|
info = mallinfo();
|
2007-02-21 17:15:19 +08:00
|
|
|
|
|
|
|
#if defined(__AIX)
|
2007-07-10 01:02:35 +08:00
|
|
|
*kilobytes = (info.arena) / 1024 ;
|
2007-02-21 17:15:19 +08:00
|
|
|
#else
|
|
|
|
*kilobytes = (info.arena + info.hblkhd) / 1024 ;
|
|
|
|
#endif
|
|
|
|
|
2006-06-26 15:50:31 +08:00
|
|
|
#else
|
2009-10-11 00:36:49 +08:00
|
|
|
void F77_FUNC(memstat,MEMSTAT)(int *kilobytes)
|
|
|
|
{
|
2006-06-26 15:50:31 +08:00
|
|
|
*kilobytes = -1;
|
2003-01-20 05:58:50 +08:00
|
|
|
#endif
|
|
|
|
}
|