1
0
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:
drh
2011-11-10 02:24:11 +00:00
parent 32121199be
commit 8225d66be6
3 changed files with 9 additions and 8 deletions

View File

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