[Pkg-wmaker-commits] [wmbubble] 22/207: Remove detritus from changing bm.samples during runtime
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Mon Aug 24 04:17:54 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmbubble.
commit acfb641fae93c4d91756c5640d65a7ecac3f4413
Author: Robert Jacobs <rnjacobs at mit.edu>
Date: Tue Jul 26 19:17:23 2011 -0700
Remove detritus from changing bm.samples during runtime
---
bubblemon.c | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/bubblemon.c b/bubblemon.c
index 75ceaf7..b778793 100644
--- a/bubblemon.c
+++ b/bubblemon.c
@@ -1372,26 +1372,9 @@ static void duck_swimmer(int posy)
}
static void bubblemon_setup_samples(void) {
- int i;
- u_int64_t load = 0, total = 0;
-
- if (bm.load) {
- load = bm.load[bm.loadIndex];
- free(bm.load);
- }
-
- if (bm.total) {
- total = bm.total[bm.loadIndex];
- free(bm.total);
- }
-
bm.loadIndex = 0;
- bm.load = malloc(bm.samples * sizeof(u_int64_t));
- bm.total = malloc(bm.samples * sizeof(u_int64_t));
- for (i = 0; i < bm.samples; i++) {
- bm.load[i] = load;
- bm.total[i] = total;
- }
+ bm.load = calloc(bm.samples, sizeof(u_int64_t));
+ bm.total = calloc(bm.samples, sizeof(u_int64_t));
}
static void bubblemon_allocate_buffers(void)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbubble.git
More information about the Pkg-wmaker-commits
mailing list