[mapserver-commits] r12892 - trunk/mapserver/mapcache/src

svn at osgeo.org svn at osgeo.org
Tue Dec 13 12:01:11 EST 2011


Author: tbonfort
Date: 2011-12-13 09:01:11 -0800 (Tue, 13 Dec 2011)
New Revision: 12892

Modified:
   trunk/mapserver/mapcache/src/imageio_png.c
Log:
use malloc instead of pools for large allocs


Modified: trunk/mapserver/mapcache/src/imageio_png.c
===================================================================
--- trunk/mapserver/mapcache/src/imageio_png.c	2011-12-13 16:59:20 UTC (rev 12891)
+++ trunk/mapserver/mapcache/src/imageio_png.c	2011-12-13 17:01:11 UTC (rev 12892)
@@ -131,7 +131,8 @@
       apr_pool_cleanup_register(ctx->pool, img->data, (void*)free, apr_pool_cleanup_null) ;
       img->stride = img->w * 4;
    }
-   row_pointers = apr_pcalloc(ctx->pool,img->h * sizeof(unsigned char*));
+   row_pointers = malloc(img->h * sizeof(unsigned char*));
+   apr_pool_cleanup_register(ctx->pool, row_pointers, (void*)free, apr_pool_cleanup_null) ;
 
    rowptr = img->data;
    for(i=0;i<img->h;i++) {
@@ -1244,7 +1245,7 @@
    if(GC_HAS_ERROR(ctx)) {
       return NULL;
    }
-   empty->data = (unsigned char*)apr_pcalloc(pool,width*height*4*sizeof(unsigned char)); 
+   empty->data = malloc(width*height*4*sizeof(unsigned char)); 
    for(i=0;i<width*height;i++) {
       ((unsigned int*)empty->data)[i] = color;
    }
@@ -1254,6 +1255,7 @@
 
    buf = format->write(ctx,empty,format);
    apr_pool_destroy(pool);
+   free(empty->data);
    return buf;
 }
 



More information about the mapserver-commits mailing list