+/* Create a new BlueSkyRCStr from a memory-mapped buffer. */
+BlueSkyRCStr *bluesky_string_new_from_mmap(BlueSkyMmap *mmap,
+ int offset, gsize len)
+{
+ g_assert(offset + len < mmap->len);
+
+ BlueSkyRCStr *string = g_new(BlueSkyRCStr, 1);
+ string->mmap = mmap;
+ g_atomic_int_inc(&mmap->refcount);
+ string->data = (char *)mmap->addr + offset;
+ string->len = len;
+ g_atomic_int_set(&string->refcount, 1);
+ return string;
+}
+