Commit 5fca5a4e authored by Philip Withnall's avatar Philip Withnall
Browse files

programming-guidelines: Clarify memory management coding style

Fix an ingrammatical sentence in c-coding-style, add a cross-reference
to the memory-management page, and clarify (in a <comment>) on that page
why we don’t mention GSlice anywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=744355
parent 46441cd0
......@@ -896,8 +896,7 @@ typedef struct _GtkFooableInterface GtkFooableInterface;</code>
<title>Memory Allocation</title>
<p>
When dynamically allocating data on the heap either use
<code>g_new()</code>.
When dynamically allocating data on the heap use <code>g_new()</code>.
</p>
<p>
......@@ -905,6 +904,10 @@ typedef struct _GtkFooableInterface GtkFooableInterface;</code>
zero-ed, either explicitly for each member, or by using
<code>g_new0()</code>.
</p>
<p>
See <link xref="memory-management"/> for more details.
</p>
</section>
<section id="macros">
......
......@@ -19,6 +19,15 @@
<title>Memory Management</title>
<comment>
<p>
Note: GSlice is deliberately not mentioned on this page because we don’t
want to encourage its use. GLib developers are moving towards deprecating
it due to its performance slipping significantly behind the libc
allocator’s on Linux in recent years.
</p>
</comment>
<comment>
<p>
FIXME:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment