diff options
Diffstat (limited to 'libpanto/src/session_store.zig')
| -rw-r--r-- | libpanto/src/session_store.zig | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libpanto/src/session_store.zig b/libpanto/src/session_store.zig index 83bf136..b929c66 100644 --- a/libpanto/src/session_store.zig +++ b/libpanto/src/session_store.zig @@ -85,8 +85,14 @@ pub const SessionStore = struct { /// Append a batch of messages atomically. `providers`/`models` are /// parallel arrays (one per message) carrying the top-level entry /// stamps (recorded on user entries). A single append is a - /// length-1 batch. Implementations consume nothing — the caller - /// retains ownership of `messages` and frees them after return. + /// length-1 batch. + /// + /// Ownership: the store **consumes** each `DiskMessage` on success + /// (takes ownership of its heap allocations). On error the store + /// frees any messages it had already taken and the caller frees the + /// rest — i.e. after this call returns the caller must not free the + /// `DiskMessage`s regardless of outcome. (The `messages` *slice* + /// itself remains the caller's.) appendMessages: *const fn ( ctx: *anyopaque, messages: []DiskMessage, |
