Re: [Vala] Lacking of a ref-counted string.



On Wed, 2008-08-20 at 22:29 +0200, Ali Sabil wrote:


On Wed, Aug 20, 2008 at 9:10 PM, Yu Feng <rainwoodman gmail com>
wrote:
        Dear Devs,
        
        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.
        
I don't really see your point, strings in vala are immutable, so there
is no real point in having them shared across objects. 

Well, it would certainly be nice to have reference counted strings to
avoid endless strdups, however, I don't think it would help if glib
introduced ref-counted strings now. The existing libraries can't and
won't just switch to the new type, so we just have to deal with multiple
string types.

Also, as strings are immutable, there would be no practical difference
in using strings in Vala, it'd really just be an optimization. As
creating a single GObject is way more expensive than a string copy, I'd
assume that string copies are usually not the biggest performance issue.

Jürg





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