pango_layout_get_pixel_size may have memory leak



Title: Samsung Enterprise Portal mySingle
Hello~!!

I have a question about pango source code.

 

pango_layout_get_pixel_size function create a glyph_extents_cache using _pango_cairo_font_private_glyph_extents_cache_init function.

And _pango_cairo_font_private_glyph_extents_cache_init function use 6144 bytes memory.

Whenever I call pango_layout_get_pixel_size function, 6144 bytes memory is used for glyph_extents_cache.

For example, twice call of pango_layout_get_pixel_size function maybe use 12288 (6144 * 2) bytes memory.

 

Below is related code,

 

static gboolean

_pango_cairo_font_private_glyph_extents_cache_init (PangoCairoFontPrivate *cf_priv)

{

...

  cf_priv->glyph_extents_cache = g_new0 (PangoCairoFontGlyphExtentsCacheEntry, GLYPH_CACHE_NUM_ENTRIES);

...

}

Size of PangoCairoFontGlyphExtentsCacheEntry is 24 and GLYPH_CACHE_NUM_ENTRIES is 256, so total 6144 bytes is used.

 

Is this code right related with use of memory?

 

Thank you in advance.

 

Regards,

Deok-Jin Kim



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]