1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Fix issue with mem5 allocator when min request size is larger thatn 2^30.

FossilOrigin-Name: d7dae06fb2d57ed6b9555b774712f42077ae4155
This commit is contained in:
shaneh
2011-03-09 21:36:17 +00:00
parent 95e037ba39
commit a6ec892b5b
6 changed files with 92 additions and 23 deletions

View File

@@ -375,6 +375,13 @@ int sqlite3_config(int op, ...){
sqlite3GlobalConfig.nHeap = va_arg(ap, int);
sqlite3GlobalConfig.mnReq = va_arg(ap, int);
if( sqlite3GlobalConfig.mnReq<1 ){
sqlite3GlobalConfig.mnReq = 1;
}else if( sqlite3GlobalConfig.mnReq>(1<<12) ){
/* cap min request size at 2^12 */
sqlite3GlobalConfig.mnReq = (1<<12);
}
if( sqlite3GlobalConfig.pHeap==0 ){
/* If the heap pointer is NULL, then restore the malloc implementation
** back to NULL pointers too. This will cause the malloc to go