aboutsummaryrefslogtreecommitdiff
path: root/src/malloc.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-12-10 15:09:17 +0000
committerdrh <drh@noemail.net>2015-12-10 15:09:17 +0000
commitac536e613a0acb84b1df80a836786b06a960f522 (patch)
treeaa0ec7898f3adba0f82f9fc82b79e1fd87185d35 /src/malloc.c
parent5ef09bf918bb26fbb900ec14850114b47f83cbfe (diff)
downloadsqlite-ac536e613a0acb84b1df80a836786b06a960f522.tar.gz
sqlite-ac536e613a0acb84b1df80a836786b06a960f522.zip
Move pointer range comparisons into a macro, where they can be dealt with
in a more portable way. FossilOrigin-Name: ad3124c834b080aaaf24934d6f08b3601ac3ae53
Diffstat (limited to 'src/malloc.c')
-rw-r--r--src/malloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/malloc.c b/src/malloc.c
index a4968aaa2..2c493b932 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -358,7 +358,7 @@ void sqlite3ScratchFree(void *p){
scratchAllocOut--;
#endif
- if( p>=sqlite3GlobalConfig.pScratch && p<mem0.pScratchEnd ){
+ if( SQLITE_WITHIN(p, sqlite3GlobalConfig.pScratch, mem0.pScratchEnd) ){
/* Release memory from the SQLITE_CONFIG_SCRATCH allocation */
ScratchFreeslot *pSlot;
pSlot = (ScratchFreeslot*)p;
@@ -394,7 +394,7 @@ void sqlite3ScratchFree(void *p){
*/
#ifndef SQLITE_OMIT_LOOKASIDE
static int isLookaside(sqlite3 *db, void *p){
- return p>=db->lookaside.pStart && p<db->lookaside.pEnd;
+ return SQLITE_WITHIN(p, db->lookaside.pStart, db->lookaside.pEnd);
}
#else
#define isLookaside(A,B) 0