Add a clarification about pairing the memory allocation and free

2007-06-23  Emmanuele Bassi  <ebassi@gnome.org>

	* glib/tmpl/memory.sgml: Add a clarification about pairing the
	memory allocation and free functions, and not mix system's
	malloc/free with the corresponding GLib ones. (#450216, Hubert
	Figuiere)

svn path=/trunk/; revision=5586
This commit is contained in:
Emmanuele Bassi 2007-06-23 21:18:05 +00:00 committed by Emmanuele Bassi
parent bd45049320
commit ce0ad84a78
2 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2007-06-23 Emmanuele Bassi <ebassi@gnome.org>
* glib/tmpl/memory.sgml: Add a clarification about pairing the
memory allocation and free functions, and not mix system's
malloc/free with the corresponding GLib ones. (#450216, Hubert
Figuiere)
2007-06-18 Matthias Clasen <mclasen@redhat.com>
* === Released 2.13.5 ===

View File

@ -8,6 +8,7 @@ general memory-handling.
<para>
These functions provide support for allocating and freeing memory.
</para>
<note>
<para>
If any call to allocate memory fails, the application is terminated.
@ -15,6 +16,16 @@ This also means that there is no need to check if the call succeeded.
</para>
</note>
<note>
<para>
It's important to match g_malloc() with 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). See also
g_mem_set_vtable().
</para>
</note>
<!-- ##### SECTION See_Also ##### -->
<para>