From d9eb3e3958953ab027ef6d180a9ea02cff26296c Mon Sep 17 00:00:00 2001 From: tsauerbeck Date: Fri, 9 Sep 2005 13:45:07 +0000 Subject: [PATCH] use valgrind's user requests to tell it that our image data should be treated as being readable SVN revision: 16670 --- .../src/lib/engines/common/evas_image_main.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/legacy/evas/src/lib/engines/common/evas_image_main.c b/legacy/evas/src/lib/engines/common/evas_image_main.c index 08ac82887b..fb93d7690a 100644 --- a/legacy/evas/src/lib/engines/common/evas_image_main.c +++ b/legacy/evas/src/lib/engines/common/evas_image_main.c @@ -6,7 +6,7 @@ #endif #ifdef HAVE_VALGRIND -#include +#include #endif static Evas_Hash * images = NULL; @@ -163,24 +163,17 @@ void evas_common_image_surface_alloc(RGBA_Surface *is) { size_t siz = 0; - 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 if (is->im->flags & RGBA_IMAGE_ALPHA_ONLY) siz = is->w * is->h * sizeof(DATA8); else siz = is->w * is->h * sizeof(DATA32); - is->data = on_valgrind ? calloc(1, siz) : malloc(siz); + is->data = malloc(siz); + +#ifdef HAVE_VALGRIND + VALGRIND_MAKE_READABLE(is->data, siz); +#endif } void