diff options
author | drh <> | 2023-07-24 12:59:53 +0000 |
---|---|---|
committer | drh <> | 2023-07-24 12:59:53 +0000 |
commit | 5202b7ca75c02c59f7f74cb59598416ac107a93d (patch) | |
tree | 1034d78d2279bffbb087fec8be52b649fc24b898 /src/sqliteInt.h | |
parent | 66422b57f9892262c0d5638a0c5d165658fcee43 (diff) | |
parent | 479cfd5af3d46e70468eda8e31c4d033955bdd29 (diff) | |
download | sqlite-5202b7ca75c02c59f7f74cb59598416ac107a93d.tar.gz sqlite-5202b7ca75c02c59f7f74cb59598416ac107a93d.zip |
Update the latest trunk enhancements into the wal-shm-exceptions branch.
FossilOrigin-Name: 3187ee3f69fc28a259ba0e951ac10a65c07ef2c3866acbefaf9544333a930cc6
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r-- | src/sqliteInt.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 770aa7071..f214862f7 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -889,8 +889,31 @@ typedef INT16_TYPE LogEst; ** the end of buffer S. This macro returns true if P points to something ** contained within the buffer S. */ -#define SQLITE_WITHIN(P,S,E) (((uptr)(P)>=(uptr)(S))&&((uptr)(P)<(uptr)(E))) +#define SQLITE_WITHIN(P,S,E) (((uptr)(P)>=(uptr)(S))&&((uptr)(P)<(uptr)(E))) +/* +** P is one byte past the end of a large buffer. Return true if a span of bytes +** between S..E crosses the end of that buffer. In other words, return true +** if the sub-buffer S..E-1 overflows the buffer show last byte is P-1. +** +** S is the start of the span. E is one byte past the end of end of span. +** +** P +** |-----------------| FALSE +** |-------| +** S E +** +** P +** |-----------------| +** |-------| TRUE +** S E +** +** P +** |-----------------| +** |-------| FALSE +** S E +*/ +#define SQLITE_OVERFLOW(P,S,E) (((uptr)(S)<(uptr)(P))&&((uptr)(E)>(uptr)(P))) /* ** Macros to determine whether the machine is big or little endian, |