[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1379 - in GNUnet: m4 src/server src/util
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1379 - in GNUnet: m4 src/server src/util |
Date: |
Sun, 10 Jul 2005 16:25:41 -0700 (PDT) |
Author: grothoff
Date: 2005-07-10 16:25:35 -0700 (Sun, 10 Jul 2005)
New Revision: 1379
Modified:
GNUnet/m4/Makefile.in
GNUnet/src/server/connection.c
GNUnet/src/util/statuscalls.c
GNUnet/src/util/statuscallstest.c
Log:
frag leak
Modified: GNUnet/m4/Makefile.in
===================================================================
--- GNUnet/m4/Makefile.in 2005-07-10 23:16:05 UTC (rev 1378)
+++ GNUnet/m4/Makefile.in 2005-07-10 23:25:35 UTC (rev 1379)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -33,7 +33,6 @@
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-build_triplet = @build@
host_triplet = @host@
subdir = m4
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
@@ -184,8 +183,6 @@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
@@ -352,7 +349,7 @@
clean-generic:
distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c 2005-07-10 23:16:05 UTC (rev 1378)
+++ GNUnet/src/server/connection.c 2005-07-10 23:25:35 UTC (rev 1379)
@@ -1337,6 +1337,7 @@
ENTRY();
if ( (se == NULL) || (se->len == 0) ) {
BREAK();
+ FREENONNULL(se);
return;
}
if ( (be->session.mtu != 0) &&
@@ -1349,6 +1350,7 @@
se->len,
se->callback,
se->closure);
+ FREE(se);
return;
}
Modified: GNUnet/src/util/statuscalls.c
===================================================================
--- GNUnet/src/util/statuscalls.c 2005-07-10 23:16:05 UTC (rev 1378)
+++ GNUnet/src/util/statuscalls.c 2005-07-10 23:25:35 UTC (rev 1379)
@@ -676,6 +676,7 @@
this datapoint. So we return -1 -- AND reset lastSum / lastCall. */
lastSum = currentLoadSum;
lastCall = now;
+ MUTEX_UNLOCK(&statusMutex);
return -1;
}
currentLoadSum += overload;
@@ -716,6 +717,7 @@
this datapoint. So we return -1 -- AND reset lastSum / lastCall. */
lastSum = currentLoadSum;
lastCall = now;
+ MUTEX_UNLOCK(&statusMutex);
return -1;
}
currentLoadSum += overload;
@@ -744,6 +746,7 @@
lastRet = -1;
return -1;
}
+ MUTEX_LOCK(&statusMutex);
ret = (100 * currentLoad) / maxCPULoad;
cronTime(&now);
@@ -752,17 +755,19 @@
/* use smoothing, but do NOT update lastRet at frequencies higher
than 250ms; this makes the smoothing (mostly) independent from
the frequency at which getCPULoad is called. */
- return (ret + 7 * lastRet)/8;
+ ret = (ret + 7 * lastRet)/8;
+ MUTEX_UNLOCK(&statusMutex);
+ return ret;
}
/* for CPU, we don't do the 'fast increase' since CPU is much
more jitterish to begin with */
if (lastRet != -1)
- lastRet = (ret + 7 * lastRet)/8;
- else
- lastRet = ret;
+ ret = (ret + 7 * lastRet)/8;
+ lastRet = ret;
lastCall = now;
- return lastRet;
+ MUTEX_UNLOCK(&statusMutex);
+ return ret;
}
/**
Modified: GNUnet/src/util/statuscallstest.c
===================================================================
--- GNUnet/src/util/statuscallstest.c 2005-07-10 23:16:05 UTC (rev 1378)
+++ GNUnet/src/util/statuscallstest.c 2005-07-10 23:25:35 UTC (rev 1379)
@@ -50,7 +50,6 @@
}
int main(int argc, char * argv[]){
- int i;
int ret;
cron_t start;
@@ -63,23 +62,13 @@
while (start + 12 * cronSECONDS > cronTime(NULL))
sleep(1);
cronTime(&start);
- ret = cpuUsage();
+ ret = getCPULoad();
while (start + 12 * cronSECONDS > cronTime(NULL))
sqrt(245.2523); /* do some processing to drive load up */
- if (ret > cpuUsage())
+ if (ret > getCPULoad())
printf("busy loop decreased CPU load: %d < %d.\n",
ret,
- cpuUsage());
-
- /* make sure we don't leak open files... */
- for (i=0;i<10000;i++) {
- if (cpuUsage() == -1)
- return -1;
- if (networkUsageUp() == -1)
- return -1;
- if (networkUsageDown() == -1)
- return -1;
- }
+ getCPULoad());
stopCron();
doneUtil();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1379 - in GNUnet: m4 src/server src/util,
grothoff <=