mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Use sqlite3MallocSize() to get the actual size of the memory allocation
used for lookaside cache and increase the size of the cache to use the full allocation. FossilOrigin-Name: 0e53ecad9468d0a13d155a4462551d4c234a7d5c
This commit is contained in:
@@ -495,6 +495,7 @@ static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){
|
||||
sqlite3BeginBenignMalloc();
|
||||
pStart = sqlite3Malloc( sz*cnt ); /* IMP: R-61949-35727 */
|
||||
sqlite3EndBenignMalloc();
|
||||
if( pStart ) cnt = sqlite3MallocSize(pStart)/sz;
|
||||
}else{
|
||||
sz = ROUNDDOWN8(sz); /* IMP: R-33038-09382 */
|
||||
pStart = pBuf;
|
||||
|
||||
Reference in New Issue
Block a user