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

Remove the rarely-used scratch memory allocator. This makes the code smaller,

faster, and easier to maintain.  In place of the scratch allocator, add the
SQLITE_CONFIG_SMALL_MALLOC configuration option that provides a hint to SQLite
that large memory allocations should be avoided.

FossilOrigin-Name: 54b000246cfb5c7b8adb61a17357ef5a49adddde9e48e8937834d5ba0beb8a6b
This commit is contained in:
drh
2017-08-28 15:51:35 +00:00
parent b3c4523c58
commit b2a0f75c06
19 changed files with 71 additions and 517 deletions

View File

@@ -7288,7 +7288,7 @@ static int balance_nonroot(
/* EVIDENCE-OF: R-28375-38319 SQLite will never request a scratch buffer
** that is more than 6 times the database page size. */
assert( szScratch<=6*(int)pBt->pageSize );
b.apCell = sqlite3ScratchMalloc( szScratch );
b.apCell = sqlite3StackAllocRaw(0, szScratch );
if( b.apCell==0 ){
rc = SQLITE_NOMEM_BKPT;
goto balance_cleanup;
@@ -7866,7 +7866,7 @@ static int balance_nonroot(
** Cleanup before returning.
*/
balance_cleanup:
sqlite3ScratchFree(b.apCell);
sqlite3StackFree(0, b.apCell);
for(i=0; i<nOld; i++){
releasePage(apOld[i]);
}