[gnome-shell] global: drop incorrect memset
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] global: drop incorrect memset
- Date: Wed, 19 Oct 2011 21:13:40 +0000 (UTC)
commit de352a309dfc3ac5c6573d95f13de0edadb5195d
Author: Ray Strode <rstrode redhat com>
Date: Wed Oct 19 16:21:59 2011 -0400
global: drop incorrect memset
shell_global_get_memory_info tries to zero initialize the output
parameter with memset, but it passes the wrong size (because of
a missing *). There's no reason to do the memset, though. In the
normal case all members of the struct gets initialized before the
function returns anyway.
This commit drops the memset call in favor of one explicit 0 assignment
that only gets executed on on atypical platforms.
https://bugzilla.gnome.org/show_bug.cgi?id=662236
src/shell-global.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/shell-global.c b/src/shell-global.c
index 26e607f..13ce7b7 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -1182,12 +1182,13 @@ shell_global_get_memory_info (ShellGlobal *global,
JSContext *context;
gint64 now;
- memset (meminfo, 0, sizeof (meminfo));
#ifdef HAVE_MALLINFO
{
struct mallinfo info = mallinfo ();
meminfo->glibc_uordblks = info.uordblks;
}
+#else
+ meminfo->glibc_uordblks = 0;
#endif
context = gjs_context_get_native_context (global->js_context);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]