1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Move pointer range comparisons into a macro, where they can be dealt with

in a more portable way.

FossilOrigin-Name: ad3124c834b080aaaf24934d6f08b3601ac3ae53
This commit is contained in:
drh
2015-12-10 15:09:17 +00:00
parent 5ef09bf918
commit ac536e613a
5 changed files with 27 additions and 18 deletions

View File

@@ -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