diff options
-rw-r--r-- | mbbsd/cal.c | 8 | ||||
-rw-r--r-- | mbbsd/xyz.c | 2 | ||||
-rw-r--r-- | sample/pttbbs.conf | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/mbbsd/cal.c b/mbbsd/cal.c index d12a1067..08289ef9 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -420,8 +420,14 @@ p_sysinfo(void) if (HAS_PERM(PERM_SYSOP)) { struct rusage ru; getrusage(RUSAGE_SELF, &ru); - prints("記憶體用量: sbrk: %d KB, idrss: %d KB, isrss: %d KB\n", + prints("記憶體用量: " +#ifdef IA32 + "sbrk: %d KB, " +#endif + "idrss: %d KB, isrss: %d KB\n", +#ifdef IA32 ((int)sbrk(0) - 0x8048000) / 1024, +#endif (int)ru.ru_idrss, (int)ru.ru_isrss); prints("CPU 用量: %ld.%06ldu %ld.%06lds", ru.ru_utime.tv_sec, ru.ru_utime.tv_usec, diff --git a/mbbsd/xyz.c b/mbbsd/xyz.c index b20b9d74..3cbeee41 100644 --- a/mbbsd/xyz.c +++ b/mbbsd/xyz.c @@ -338,12 +338,14 @@ m_sysop() void log_memoryusage(void) { +#ifdef IA32 int use=((int)sbrk(0)-0x8048000)/1024; if(use<500) use=499; if(use>1000) use=1000; GLOBALVAR[use/100-4]++; // use [0]~[6] +#endif } int diff --git a/sample/pttbbs.conf b/sample/pttbbs.conf index 8527f536..e8b4481c 100644 --- a/sample/pttbbs.conf +++ b/sample/pttbbs.conf @@ -157,6 +157,9 @@ /* 贈送信箱 */ //#define ADD_EXMAILBOX 100 +/* 如果是在 IA32 底下的話, 可以定義 IA32 以取得記憶體統計資訊 */ +//#define IA32 + /* 前進站畫面 */ #define INSCREEN \ "前進站畫面 (請至 pttbbs.conf 修改您的前進站畫面)" |