mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
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:
parent
bd45049320
commit
ce0ad84a78
@ -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 ===
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user