lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <mar...@rectangular.com>
Subject Re: [lucy-dev] CharBuf functions taking char* arguments
Date Wed, 24 Apr 2013 18:58:02 GMT
On Wed, Apr 24, 2013 at 10:48 AM, Nick Wellnhofer <wellnhofer@aevum.de> wrote:
> Switching to iterators at the same time also seems like a good idea.

+1

Removing mutability not only means splicing out the code that actually changes
content, it also means removing unnecessary checks and revisiting assumptions
about invariants.  Changing up to use iterators while making the transition
makes sense.

> For substrings with a shared buffer, we could use something similar to
> ViewCharBuf, only with an additional reference to the original string for
> refcounting.

Ha!  I hadn't thought of the recursive String approach for sharing buffers.

> +1. Maybe Export_Raw_UTF should simply return a malloced raw pointer and
> make it the caller's responsibility to free it.

+1

We probably want to use malloc() directly rather than MALLOCATE, which can be
wrap a different allocator and must be paired with FREEMEM.

Marvin Humphrey

Mime
View raw message