<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/glib.git/gobject/gatomicarray.c, branch pgriffis/wip/resolver-https</title>
<subtitle>gitlab.gnome.org: GNOME/glib.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/'/>
<entry>
<title>gatomicarray: suppress valgrind memory leak warnings</title>
<updated>2020-11-24T14:10:58+00:00</updated>
<author>
<name>Michael Catanzaro</name>
<email>mcatanzaro@gnome.org</email>
</author>
<published>2020-11-23T21:51:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=a412ffe4d3b3775c00703cf31dd302b1200fd0e5'/>
<id>a412ffe4d3b3775c00703cf31dd302b1200fd0e5</id>
<content type='text'>
The problem occurs because we keep a pointer inside the allocated block,
instead of a pointer to the start of the block:

```
==180238== 16 bytes in 1 blocks are possibly lost in loss record 3,086 of 16,075
==180238==    at 0x483980B: malloc (vg_replace_malloc.c:309)
==180238==    by 0x548942C: g_malloc (gmem.c:102)
==180238==    by 0x54A4748: g_slice_alloc (gslice.c:1025)
==180238==    by 0x53D0AAF: freelist_alloc (gatomicarray.c:77)
==180238==    by 0x53D0B85: _g_atomic_array_copy (gatomicarray.c:133)
==180238==    by 0x53F8E6D: iface_node_set_offset_L (gtype.c:1347)
==180238==    by 0x53F91F1: type_node_add_iface_entry_W (gtype.c:1444)
==180238==    by 0x53F93DF: type_add_interface_Wm (gtype.c:1477)
==180238==    by 0x53FC946: g_type_add_interface_static (gtype.c:2852)
==180238==    by 0x4A3D53A: gtk_menu_shell_accessible_get_type_once (gtkmenushellaccessible.c:26)
==180238==    by 0x4A3D495: gtk_menu_shell_accessible_get_type (gtkmenushellaccessible.c:26)
==180238==    by 0x4C8AC44: gtk_menu_shell_class_init (gtkmenushell.c:424)
```

Note we cannot use VALGRIND_FREELIKE_BLOCK() in freelist_free() because we
have not actually freed the FreeListNode and need to dereference it in
freelist_alloc() to decide whether to reuse the block. That would result
in a use-after-free warning before we would get a chance to call
VALGRIND_MALLOCLIKE_BLOCK() in the reuse path.

Also note that this free list only ever grows: it never shrinks for the
lifetime of the application, so nothing here will ever be truely freed,
although unused elements are eligible for reuse.

Fix suggested by Philip Withnall

Related: #2076
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The problem occurs because we keep a pointer inside the allocated block,
instead of a pointer to the start of the block:

```
==180238== 16 bytes in 1 blocks are possibly lost in loss record 3,086 of 16,075
==180238==    at 0x483980B: malloc (vg_replace_malloc.c:309)
==180238==    by 0x548942C: g_malloc (gmem.c:102)
==180238==    by 0x54A4748: g_slice_alloc (gslice.c:1025)
==180238==    by 0x53D0AAF: freelist_alloc (gatomicarray.c:77)
==180238==    by 0x53D0B85: _g_atomic_array_copy (gatomicarray.c:133)
==180238==    by 0x53F8E6D: iface_node_set_offset_L (gtype.c:1347)
==180238==    by 0x53F91F1: type_node_add_iface_entry_W (gtype.c:1444)
==180238==    by 0x53F93DF: type_add_interface_Wm (gtype.c:1477)
==180238==    by 0x53FC946: g_type_add_interface_static (gtype.c:2852)
==180238==    by 0x4A3D53A: gtk_menu_shell_accessible_get_type_once (gtkmenushellaccessible.c:26)
==180238==    by 0x4A3D495: gtk_menu_shell_accessible_get_type (gtkmenushellaccessible.c:26)
==180238==    by 0x4C8AC44: gtk_menu_shell_class_init (gtkmenushell.c:424)
```

Note we cannot use VALGRIND_FREELIKE_BLOCK() in freelist_free() because we
have not actually freed the FreeListNode and need to dereference it in
freelist_alloc() to decide whether to reuse the block. That would result
in a use-after-free warning before we would get a chance to call
VALGRIND_MALLOCLIKE_BLOCK() in the reuse path.

Also note that this free list only ever grows: it never shrinks for the
lifetime of the application, so nothing here will ever be truely freed,
although unused elements are eligible for reuse.

Fix suggested by Philip Withnall

Related: #2076
</pre>
</div>
</content>
</entry>
<entry>
<title>minor typos in the documentation (a/an)</title>
<updated>2019-08-24T19:14:05+00:00</updated>
<author>
<name>Дилян Палаузов</name>
<email>git-dpa@aegee.org</email>
</author>
<published>2019-08-23T21:45:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=512655aa124b03c38990ce28203348939910a0a5'/>
<id>512655aa124b03c38990ce28203348939910a0a5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>gobject/: LGPLv2+ -&gt; LGPLv2.1+</title>
<updated>2017-05-24T09:58:19+00:00</updated>
<author>
<name>Sébastien Wilmet</name>
<email>swilmet@gnome.org</email>
</author>
<published>2017-01-05T13:09:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=6b948d9613f2dcdec72828f3429ba01403063ff2'/>
<id>6b948d9613f2dcdec72828f3429ba01403063ff2</id>
<content type='text'>
All gobject/*.{c,h} files have been processed.

gmarshal.c and gmarshal.h don't have a license header.

https://bugzilla.gnome.org/show_bug.cgi?id=776504
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All gobject/*.{c,h} files have been processed.

gmarshal.c and gmarshal.h don't have a license header.

https://bugzilla.gnome.org/show_bug.cgi?id=776504
</pre>
</div>
</content>
</entry>
<entry>
<title>Updated FSF's address</title>
<updated>2014-01-31T13:31:55+00:00</updated>
<author>
<name>Daniel Mustieles</name>
<email>daniel.mustieles@gmail.com</email>
</author>
<published>2014-01-23T11:58:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=078dbda148a81af1b3a76fbda72f089b963087f1'/>
<id>078dbda148a81af1b3a76fbda72f089b963087f1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Improvde #include order consistency</title>
<updated>2013-01-01T18:54:54+00:00</updated>
<author>
<name>Matthias Clasen</name>
<email>mclasen@redhat.com</email>
</author>
<published>2013-01-01T18:54:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=f2e00a07f49d6ad0e8d790396bcdea913592ce33'/>
<id>f2e00a07f49d6ad0e8d790396bcdea913592ce33</id>
<content type='text'>
This was mostly fixed already, just re-fix a few details here.
https://bugzilla.gnome.org/show_bug.cgi?id=71704
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was mostly fixed already, just re-fix a few details here.
https://bugzilla.gnome.org/show_bug.cgi?id=71704
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove a redundant assertion</title>
<updated>2011-06-14T22:51:57+00:00</updated>
<author>
<name>Matthias Clasen</name>
<email>mclasen@redhat.com</email>
</author>
<published>2011-06-14T20:20:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=6e7a7052e01ef8e44891e9290c5275c3b3d6e07d'/>
<id>6e7a7052e01ef8e44891e9290c5275c3b3d6e07d</id>
<content type='text'>
A gsize is never going below 0.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A gsize is never going below 0.
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't do pointer arithmetics on void*</title>
<updated>2010-01-07T08:14:24+00:00</updated>
<author>
<name>Haakon Sporsheim</name>
<email>haakon.sporsheim@gmail.com</email>
</author>
<published>2010-01-07T08:12:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=4c55b45162a3a76ca6c1d1c450ea667eeb7bae44'/>
<id>4c55b45162a3a76ca6c1d1c450ea667eeb7bae44</id>
<content type='text'>
For instance MSVC doesn't like that.

Signed-off-by: Tor Lillqvist &lt;tml@iki.fi&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For instance MSVC doesn't like that.

Signed-off-by: Tor Lillqvist &lt;tml@iki.fi&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add GAtomicArray for RCU-style lockless updates</title>
<updated>2009-11-30T19:48:50+00:00</updated>
<author>
<name>Alexander Larsson</name>
<email>alexl@redhat.com</email>
</author>
<published>2009-09-09T14:47:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=75ce4741f9a7a26098a77407de9b4cc2b985a254'/>
<id>75ce4741f9a7a26098a77407de9b4cc2b985a254</id>
<content type='text'>
This adds supports for a lock-less a non-shrinking growable array.
You can use it to do reads using no locks, as long as your read-code
can handle that during the read transaction the object can be modified
by another writer (but it will not change size or be freed), and you
can only trust the result once the transaction has finished successfully.

This doesn't free things like RCU normally does, instead it pushes the
memory on a free list that is reused for other atomic arrays.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds supports for a lock-less a non-shrinking growable array.
You can use it to do reads using no locks, as long as your read-code
can handle that during the read transaction the object can be modified
by another writer (but it will not change size or be freed), and you
can only trust the result once the transaction has finished successfully.

This doesn't free things like RCU normally does, instead it pushes the
memory on a free list that is reused for other atomic arrays.
</pre>
</div>
</content>
</entry>
</feed>
