Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/xrender_x11
Modified Files:
evas_engine_font.c evas_engine_image.c
Log Message:
use stringshare. saves a few hundred allocs... if we start doing lots of text
:)
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/xrender_x11/evas_engine_font.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- evas_engine_font.c 16 Nov 2005 13:17:27 -0000 1.4
+++ evas_engine_font.c 28 Nov 2005 15:18:01 -0000 1.5
@@ -86,8 +86,7 @@
int bi, bj, end;
const DATA8 bitrepl[2] = {0x0, 0xff};
- tmpbuf = malloc(w);
- if (tmpbuf)
+ tmpbuf = alloca(w);
{
int x, y;
DATA8 *p1, *p2;
@@ -117,7 +116,6 @@
p2++;
}
}
- free(tmpbuf);
}
}
_xr_image_put(xim, fs->draw, 0, 0, w, h);
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/xrender_x11/evas_engine_image.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- evas_engine_image.c 26 Oct 2005 20:32:27 -0000 1.8
+++ evas_engine_image.c 28 Nov 2005 15:18:01 -0000 1.9
@@ -94,15 +94,15 @@
im->xinf = xinf;
im->xinf->references++;
im->fkey = strdup(buf);
- im->file = strdup(file);
- if (key) im->key = strdup(key);
+ im->file = evas_stringshare_add(file);
+ if (key) im->key = evas_stringshare_add(key);
im->w = im->im->image->w;
im->h = im->im->image->h;
im->references = 1;
- if (im->im->info.comment) im->comment = strdup(im->im->info.comment);
- if (im->im->info.format == 1) im->format = strdup("png");
+ if (im->im->info.comment) im->comment =
evas_stringshare_add(im->im->info.comment);
+ if (im->im->info.format == 1) im->format = evas_stringshare_add("png");
if (im->im->flags & RGBA_IMAGE_HAS_ALPHA) im->alpha = 1;
- _xr_image_hash = evas_hash_add(_xr_image_hash, im->fkey, im);
+ _xr_image_hash = evas_hash_direct_add(_xr_image_hash, im->fkey, im);
return im;
}
@@ -186,15 +186,15 @@
static void
__xre_image_real_free(XR_Image *im)
{
- if (im->file) free(im->file);
- if (im->key) free(im->key);
+ if (im->file) evas_stringshare_del(im->file);
+ if (im->key) evas_stringshare_del(im->key);
if (im->fkey) free(im->fkey);
if (im->im) evas_common_image_unref(im->im);
if ((im->data) && (im->dirty)) __xre_image_dirty_hash_del(im);
if ((im->free_data) && (im->data)) free(im->data);
if (im->surface) _xr_render_surface_free(im->surface);
- if (im->format) free(im->format);
- if (im->comment) free(im->comment);
+ if (im->format) evas_stringshare_del(im->format);
+ if (im->comment) evas_stringshare_del(im->comment);
if (im->updates) evas_common_tilebuf_free(im->updates);
_xr_image_info_free(im->xinf);
free(im);
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs