speechd-discuss
[Top][All Lists]
Advanced

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

memory allocation clarification


From: jose vilmar estacio de souza
Subject: memory allocation clarification
Date: Wed, 17 Feb 2010 22:58:35 -0200

Hi all,
I am trying to debug a problem that is present in sd_ibmtts.

looking at the code, I got the feeling that the command malloc is being 
used to allocate memory and the command g_free is being used to release 
the same memory.

I found the folloing at 
http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html:

It's important to match |g_malloc()| 
<http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-malloc>
 
with |g_free()| 
<http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free>,
 
plain |malloc()| with |free()|, and (if you're using C++) new with 
delete and new[] with delete[]. Otherwise bad things can happen, since 
these allocators may use different memory pools (and new/delete call 
constructors and destructors).

Am I missing something?
Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20100217/32a189c8/attachment.htm>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]