Replace a string with a memory-mapped version as soon as possible when the
item is written out. The intent is that memory-mapped versions rely on the
kernel's memory management, and don't need to be written to swap like a
private copy would, and so should give better overall system memory
management.
offset += sizeof(header) + sizeof(footer) + item->data->len;
+ /* Replace the log item's string data with a memory-mapped copy of the
+ * data, now that it has been written to the log file. (Even if it
+ * isn't yet on disk, it should at least be in the page cache and so
+ * available to memory map.) */
+ bluesky_string_unref(item->data);
+ item->data = NULL;
+ bluesky_cloudlog_fetch(item);
+
log->committed = g_slist_prepend(log->committed, item);
g_atomic_int_add(&item->data_lock_count, -1);
g_mutex_unlock(item->lock);