Explicitly say that begin must be < end in interface

This commit is contained in:
2024-07-10 17:05:08 -07:00
parent d50bb8bc80
commit 687bc9c935

View File

@@ -52,7 +52,7 @@ struct __attribute__((__visibility__("default"))) ConflictSet {
struct ReadRange { struct ReadRange {
Key begin; Key begin;
/** `end` having length 0 denotes that this range is the single key {begin}. /** `end` having length 0 denotes that this range is the single key {begin}.
* Otherwise this denotes the range [begin, end) */ * Otherwise this denotes the range [begin, end), and begin must be < end */
Key end; Key end;
/** `readVersion` older than the the oldestVersion or the version of the /** `readVersion` older than the the oldestVersion or the version of the
* latest call to `addWrites` minus two billion will result in `TooOld` */ * latest call to `addWrites` minus two billion will result in `TooOld` */
@@ -63,7 +63,7 @@ struct __attribute__((__visibility__("default"))) ConflictSet {
struct WriteRange { struct WriteRange {
Key begin; Key begin;
/** `end` having length 0 denotes that this range is the single key {begin}. /** `end` having length 0 denotes that this range is the single key {begin}.
* Otherwise this denotes the range [begin, end) */ * Otherwise this denotes the range [begin, end), and begin must be < end */
Key end; Key end;
}; };
@@ -139,7 +139,7 @@ typedef struct {
typedef struct { typedef struct {
ConflictSet_Key begin; ConflictSet_Key begin;
/** `end` having length 0 denotes that this range is the single key {begin}. /** `end` having length 0 denotes that this range is the single key {begin}.
* Otherwise this denotes the range [begin, end) */ * Otherwise this denotes the range [begin, end), and begin must be < end */
ConflictSet_Key end; ConflictSet_Key end;
/** `readVersion` older than the the oldestVersion or the version of the /** `readVersion` older than the the oldestVersion or the version of the
* latest call to `addWrites` minus two billion will result in `TooOld` */ * latest call to `addWrites` minus two billion will result in `TooOld` */
@@ -150,7 +150,7 @@ typedef struct {
typedef struct { typedef struct {
ConflictSet_Key begin; ConflictSet_Key begin;
/** `end` having length 0 denotes that this range is the single key {begin}. /** `end` having length 0 denotes that this range is the single key {begin}.
* Otherwise this denotes the range [begin, end) */ * Otherwise this denotes the range [begin, end), and begin must be < end */
ConflictSet_Key end; ConflictSet_Key end;
} ConflictSet_WriteRange; } ConflictSet_WriteRange;