From 1406758a5a2e38392e54cb7ba7a00a0f80ee1567 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sun, 14 Sep 2025 00:26:39 -0400 Subject: Merging configurations --- pom.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'pom.h') diff --git a/pom.h b/pom.h index 4473562..147720a 100644 --- a/pom.h +++ b/pom.h @@ -14,9 +14,11 @@ /// have certainly read their keys before calling it). /// /// If C11 atomics are not available, you can almost certainly still get away -/// with sharing configurations across threads. +/// with sharing configurations across threads, as long as you use proper +/// synchronization for \ref pom_conf_next_unread_key. /// (Essentially, libpom may end up writing the same value to the same address -/// from separate threads, which will likely never be an issue on any real machine.) +/// from separate threads, which is *technically* undefined behaviour, but will +/// likely never be an issue on any real machine.) /// Even if you are extremely paranoid, you can still use /// distinct configurations in different threads without worry. @@ -425,7 +427,9 @@ POM__MUST_USE_R; /// is called, so if you are repeatedly calling this function (unlikely, but who knows), /// you should make a copy of `conf` after each call (with \ref pom_conf_copy), /// then free the old value of `conf`. -void +/// +/// Returns `false` on out-of-memory, in which case `conf` is unchanged. +bool pom_conf_merge(pom_conf *conf, const pom_conf *other); /// Get all unread keys in `conf`. -- cgit v1.2.3