1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Remove all references to SQLITE_DEFAULT_TEMP_CACHE_SIZE. Add requirements

marks related to cache_size changing.

FossilOrigin-Name: 766ad65025a9d5815300978e6e349f5af5db6012
This commit is contained in:
drh
2015-02-27 21:53:35 +00:00
parent 9d356fbe6e
commit e0e8429543
5 changed files with 22 additions and 19 deletions

View File

@@ -114,12 +114,20 @@ static void pcacheUnpin(PgHdr *p){
}
/*
** Compute the number of pages of cache requested.
** Compute the number of pages of cache requested. p->szCache is the
** cache size requested by the "PRAGMA cache_size" statement.
**
**
*/
static int numberOfCachePages(PCache *p){
if( p->szCache>=0 ){
/* IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the
** suggested cache size is set to N. */
return p->szCache;
}else{
/* IMPLEMENTATION-OF: R-61436-13639 If the argument N is negative, then
** the number of cache pages is adjusted to use approximately abs(N*1024)
** bytes of memory. */
return (int)((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
}
}