From 24e63a0d2d1dd924026d7180f98784650044a718 Mon Sep 17 00:00:00 2001 From: Thomas Thurman Date: Sun, 13 Jul 2008 05:27:13 +0000 Subject: [PATCH] Don't allocate memory for log messages unless we're logging. 2008-07-12 Thomas Thurman * src/core/constraints.c (do_screen_and_xinerama_relative_constraints): Don't allocate memory for log messages unless we're logging. svn path=/trunk/; revision=3786 --- ChangeLog | 5 +++++ src/core/constraints.c | 15 +++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e26ec053f..4752e5b98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-12 Thomas Thurman + + * src/core/constraints.c (do_screen_and_xinerama_relative_constraints): + Don't allocate memory for log messages unless we're logging. + 2008-07-12 Thomas Thurman * src/core/group.c (meta_window_get_group): This function can now diff --git a/src/core/constraints.c b/src/core/constraints.c index 54dc794a9..a7601a775 100644 --- a/src/core/constraints.c +++ b/src/core/constraints.c @@ -1070,13 +1070,16 @@ do_screen_and_xinerama_relative_constraints ( MetaRectangle how_far_it_can_be_smushed, min_size, max_size; #ifdef WITH_VERBOSE_MODE - /* First, log some debugging information */ - char spanning_region[1 + 28 * g_list_length (region_spanning_rectangles)]; + if (meta_is_verbose ()) + { + /* First, log some debugging information */ + char spanning_region[1 + 28 * g_list_length (region_spanning_rectangles)]; - meta_topic (META_DEBUG_GEOMETRY, - "screen/xinerama constraint; region_spanning_rectangles: %s\n", - meta_rectangle_region_to_string (region_spanning_rectangles, ", ", - spanning_region)); + meta_topic (META_DEBUG_GEOMETRY, + "screen/xinerama constraint; region_spanning_rectangles: %s\n", + meta_rectangle_region_to_string (region_spanning_rectangles, ", ", + spanning_region)); + } #endif /* Determine whether constraint applies; exit if it doesn't */