On 24/04/2015 06:17, Marvin Humphrey wrote:
I'd like to propose a new class for the Clownfish core: Blob, a
wrapper for constant binary data.
Blob is to ByteBuf as String is to CharBuf.
Introducing Blob will allow us to wrap host-supplied arbitrary binary
data the same way we wrap host-supplied UTF-8 content with String.
Right now we wrap such data with ByteBuf, which is dangerous because
ByteBuf allows the content to be manipulated.
I started with the implementation of Blob:
https://github.com/nwellnhof/lucy-clownfish/commits/CLOWNFISH-11-blob
I also switched most of Lucy over to Blob:
https://github.com/nwellnhof/lucy/commits/CLOWNFISH-11-blob
ByteBufs remain at the following locations:
* As argument to Read_Record in the default readers. These methods
could be changed to return an incremented Blob, incurring
additional memory allocations.
* `anchor_set` ivar in PhraseMatcher.
* Backing store of RAMFiles.
* MemoryPool arenas.
Nick