Re: Relationship between Glib and Gobject
- From: "Matthias Clasen" <matthias clasen gmail com>
- To: "Ian Turner" <ian zmanda com>
- Cc: gtk-list gnome org
- Subject: Re: Relationship between Glib and Gobject
- Date: Thu, 23 Feb 2006 14:55:06 -0500
On 2/23/06, Ian Turner <ian zmanda com> wrote:
> Hello all,
>
> Yesterday I started reading the GLib documentation in-depth, and I was
> startled to find that the GLib core does not depend on the GObject system. So
> the string library, for example, is not reference-counted.
>
> Furthermore, it appears that while the GLib type system (that is, the gobject
> library) provides an encapsulation method (GBoxed), it does not provide any
> kind of smart-pointer functionality. You can use a GBoxed string, or you can
> put a string in a GValue, but only GObjects have reference counts.
>
> So,
> 1) Please let me know if any of the foregoing is incorrect or misled.
> 2) Is there any (easy) way to fudge a smart-pointer in GLib?
>
Your impressions are largely correct. There is nothing that prevents you
from makeing a refcounted boxed type, though. Just make copy==ref
and destroy=unref. Don't know if thats smart enough...
Matthias
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]