summaryrefslogtreecommitdiffstats
path: root/mbbsd/xyz.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-01-17 04:22:06 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-01-17 04:22:06 +0800
commitcab9d16f21db67973564c64acf1c56f6c3848f5c (patch)
treec6f233bbd99b65d7e9f3e9e251886ffdf22dd981 /mbbsd/xyz.c
parente8593b7a3be8a705308a11fa753e33f0f44e8eff (diff)
downloadpttbbs-cab9d16f21db67973564c64acf1c56f6c3848f5c.tar
pttbbs-cab9d16f21db67973564c64acf1c56f6c3848f5c.tar.gz
pttbbs-cab9d16f21db67973564c64acf1c56f6c3848f5c.tar.bz2
pttbbs-cab9d16f21db67973564c64acf1c56f6c3848f5c.tar.lz
pttbbs-cab9d16f21db67973564c64acf1c56f6c3848f5c.tar.xz
pttbbs-cab9d16f21db67973564c64acf1c56f6c3848f5c.tar.zst
pttbbs-cab9d16f21db67973564c64acf1c56f6c3848f5c.zip
counting memory usage
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@615 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/xyz.c')
-rw-r--r--mbbsd/xyz.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/mbbsd/xyz.c b/mbbsd/xyz.c
index f00087f2..707ae02e 100644
--- a/mbbsd/xyz.c
+++ b/mbbsd/xyz.c
@@ -1,4 +1,4 @@
-/* $Id: xyz.c,v 1.13 2003/01/16 11:58:05 kcwu Exp $ */
+/* $Id: xyz.c,v 1.14 2003/01/16 20:22:06 kcwu Exp $ */
#include "bbs.h"
/* 各種統計及相關資訊列表 */
@@ -332,6 +332,17 @@ m_sysop()
return 0;
}
+void
+log_memoryusage(void)
+{
+ int use=((int)sbrk(0)-0x8048000)/1024;
+ if(use<500)
+ use=499;
+ if(use>1000)
+ use=1000;
+ GLOBALVAR[use/100-4]++; // use [0]~[6]
+}
+
int
Goodbye()
{
@@ -353,6 +364,7 @@ Goodbye()
else if (genbuf[0] == 'n')
note();
}
+ log_memoryusage();
clear();
prints("\033[1;36m親愛的 \033[33m%s(%s)\033[36m,別忘了再度光臨\033[45;33m"
" %s \033[40;36m!\n以下是您在站內的註冊資料:\033[0m\n",