[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>
- [PATCH] Corrected some memory leacs in src/tests/run_test.c, Rui Batista, 2010/02/16
- [PATCH] Corrected some memory leacs in src/tests/run_test.c, Chris Brannon, 2010/02/16
- [PATCH] Corrected some memory leacs in src/tests/run_test.c, Rui Batista, 2010/02/16
- [PATCH] Corrected some memory leacs in src/tests/run_test.c, Rui Batista, 2010/02/16
- [PATCH] Corrected some memory leacs in src/tests/run_test.c, Rui Batista, 2010/02/16
- memory allocation clarification,
jose vilmar estacio de souza <=
- memory allocation clarification, Luke Yelavich, 2010/02/17
- memory allocation clarification, jose vilmar estacio de souza, 2010/02/18
- memory allocation clarification, Chris Brannon, 2010/02/19
- memory allocation clarification, jose vilmar estacio de souza, 2010/02/20
- memory allocation clarification, Chris Brannon, 2010/02/20
- memory allocation clarification, jose vilmar estacio de souza, 2010/02/20
- memory allocation clarification, Chris Brannon, 2010/02/22
- memory allocation clarification, jose vilmar estacio de souza, 2010/02/22