memory allocation clarification
Luke Yelavich
luke.yelavich at canonical.com
Thu Feb 18 02:07:28 CET 2010
On Thu, Feb 18, 2010 at 11:58:35AM EST, jose vilmar estacio de souza wrote:
> 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?
This sounds correct. I believe one of Chris' recent patches for speech-dispatcher corrected such an issue.
Luke
More information about the Speechd
mailing list