Re: Lacking of a ref-counted string.



2008/8/23 Havoc Pennington <hp pobox com>:
>> How much more complicated is it for bindings (most of which use ref-counted strings themselves) to wrap a reference to a
>> string instead of wrapping a whole new copy of the string.
>
> This one I can answer: most bindings would have to copy the strings
> into a native string type just as they do now. A few, maybe Vala and
> C++, could conceivably avoid the copy. So refcounted strings would not
> matter much for bindings in general but might help the C-like
> bindings.

Naturally, they wouldn't have to copy the actual string data and you
are forgetting all these "The returned string is owned by the
$something object and should not be freed. " All that just magically
disappears with ref-counted strings. The bindings become one step
simpler because there is one bit less information that they need to
account for.


-- 
mvh Björn


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