Re: Memory improvement for the tokens in camel_folder_summary.c

"Veerapuram Varadhan" <[email protected]>
Newsgroups gmane.comp.gnome.evolution.patches
Message-ID <[email protected]>
On Wed, 2006-07-26 at 10:40 +0000, Philip Van Hoof wrote:
> > gchar *str = NULL;
> > str = camel_header_msgid_decode (camel_header_raw_find (&h,
> > "content-id", NULL));
> > ci->id = token_add (str);
> > g_free (str);
> 
> This creates memory segmentation as the only time the string needs to
> be
> freed, is when it's already found in the tokens table.
> 
> This way, it will always be freed. That's the reason why the free
> happens in token_add (and why token_add is a static or implementation
> detail of camel-folder-summary.c). 

As pointed out in IRC, when a string that is not in static tokens table,
but, exists in pstring-table, this patch would leak that *string*.

Phillip: How about an updated patch with discussed changes? (by removing
camel_pstring_*)... which will more or less look like the current
implementation, however, saves some *g_strdups*.

V. Varadhan

 Novell, Inc. 
Software for the Open Enterprise™
http://www.novell.com
_______________________________________________
Evolution-patches mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/evolution-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.