From 68295967a90f7f99b07a192f616c7d27a7f62618 Mon Sep 17 00:00:00 2001 From: norad Date: Fri, 11 Feb 2011 17:57:55 +0000 Subject: [PATCH] Revert "Patch:graphics/sdl:use g_alloca for temporary allocations|That's much cheaper than g_mallog + g_free" This reverts commit 42bdd07e990b489637caa82eb1196b2420ef4366. git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4131 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/navit/graphics/sdl/graphics_sdl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/navit/navit/graphics/sdl/graphics_sdl.c b/navit/navit/graphics/sdl/graphics_sdl.c index 58cc562..af0ecfa 100644 --- a/navit/navit/graphics/sdl/graphics_sdl.c +++ b/navit/navit/graphics/sdl/graphics_sdl.c @@ -986,7 +986,7 @@ display_text_draw(struct font_freetype_text *text, if (g->w && g->h && bg) { stride = (g->w + 2) * 4; if (color) { - shadow = g_alloca(stride * (g->h + 2)); + shadow = g_malloc(stride * (g->h + 2)); gr->freetype_methods.get_shadow(g, shadow, 32, stride, &white, &transparent); SDL_Surface *glyph_surface = @@ -1004,6 +1004,7 @@ display_text_draw(struct font_freetype_text *text, SDL_BlitSurface(glyph_surface, NULL, gr->screen, &r); SDL_FreeSurface(glyph_surface); } + g_free(shadow); } } x += g->dx; @@ -1020,7 +1021,7 @@ display_text_draw(struct font_freetype_text *text, if (color) { stride = g->w; if (bg) { - glyph = g_alloca(stride * g->h * 4); + glyph = g_malloc(stride * g->h * 4); gr->freetype_methods.get_glyph(g, glyph, 32, stride * 4, &black, &white, &transparent); @@ -1038,9 +1039,10 @@ display_text_draw(struct font_freetype_text *text, SDL_BlitSurface(glyph_surface, NULL, gr->screen,&r); SDL_FreeSurface(glyph_surface); } + g_free(glyph); } stride *= 4; - glyph = g_alloca(stride * g->h); + glyph = g_malloc(stride * g->h); gr->freetype_methods.get_glyph(g, glyph, 32, stride, &black, &white, &transparent); @@ -1061,6 +1063,7 @@ display_text_draw(struct font_freetype_text *text, pGlyph += 4; } } + g_free(glyph); } } x += g->dx; -- 2.7.4