Enlightenment CVS committal

Author  : tsauerbeck
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/engines/common


Modified Files:
        Makefile.am evas_image_main.c 


Log Message:
Initialize image data to zero if we're running under Valgrind's control. This means 
the suppression file is no longer needed.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- Makefile.am 17 Feb 2004 07:12:37 -0000      1.5
+++ Makefile.am 2 May 2004 08:41:11 -0000       1.6
@@ -5,8 +5,8 @@
 # A list of all the files in the current directory which can be regenerated
 MAINTAINERCLEANFILES = Makefile.in
 
-LDFLAGS                     = 
-INCLUDES            = @freetype_cflags@ \
+LDFLAGS                     = @VALGRIND_LIBS@
+INCLUDES            = @freetype_cflags@ @VALGRIND_CFLAGS@ \
                        -I. \
                       -I$(top_srcdir)/src/lib \
                       -I$(top_srcdir)/src/lib/include
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_image_main.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- evas_image_main.c   30 Jan 2004 05:46:57 -0000      1.12
+++ evas_image_main.c   2 May 2004 08:41:11 -0000       1.13
@@ -5,6 +5,10 @@
 #include <Eet.h>
 #endif
 
+#ifdef HAVE_VALGRIND
+#include <valgrind/valgrind.h>
+#endif
+
 static Evas_Hash        * images = NULL;
 static Evas_Object_List * cache = NULL;
 static int                cache_size = 0;
@@ -91,7 +95,21 @@
 void
 evas_common_image_surface_alloc(RGBA_Surface *is)
 {
-   is->data = malloc(is->w * is->h * sizeof(DATA32));
+   size_t siz = is->w * is->h * sizeof(DATA32);
+   static int on_valgrind;
+
+   /* init data when we're under Valgrind's control */
+#ifdef HAVE_VALGRIND
+   static int init;
+
+   if (!init)
+     {
+       on_valgrind = RUNNING_ON_VALGRIND;
+       init = 1;
+     }
+#endif
+
+   is->data = on_valgrind ? calloc(1, siz) : malloc(siz);
 }
 
 void




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to