Re: Lacking of a ref-counted string.



2008/8/20 Ali Sabil <ali sabil gmail com>:
> On Wed, Aug 20, 2008 at 9:15 PM, Bastien Nocera <hadess hadess net> wrote:
>> On Wed, 2008-08-20 at 15:10 -0400, Yu Feng wrote:
>> > Is there any particular reason that GLib doesn't provide a ref-counted
>> > string and a ref-counted array type? Lacking them in GLib makes the VALA
>> > language a real pain.
>>
>> You could just wrap simple GObjects around GString and GPtrArray.
>
> Wouldn't that be overkill ? do we need signals and properties for strings
> and arrays ? maybe GLib/GObject should have something like GstMiniObject
> that only provides reference counting and no signals/properties ?

It's quite easy to make an immutable refcounted string with GValue.
This should be quite a bit lighter than a GObject implementation.
Fwiw, my code is here:

  http://vips.svn.sourceforge.net/viewvc/vips/vips7/trunk/libsrc/iofuncs/meta.c?view=markup

search for 'refstring'.

John


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]