mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-09 14:21:03 +03:00
Make use of sqlite3DbMallocSize to maximize the size of growable buffers
after each reallocation. Added new comments and testcase() macros to where.c. (CVS 5981) FossilOrigin-Name: 46f2d08959423e130a5b346138311649d92f0fde
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
**
|
||||
** Memory allocation functions used throughout sqlite.
|
||||
**
|
||||
** $Id: malloc.c,v 1.48 2008/11/19 09:05:27 danielk1977 Exp $
|
||||
** $Id: malloc.c,v 1.49 2008/12/05 15:24:17 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <stdarg.h>
|
||||
@@ -505,7 +505,9 @@ int sqlite3MallocSize(void *p){
|
||||
return sqlite3GlobalConfig.m.xSize(p);
|
||||
}
|
||||
int sqlite3DbMallocSize(sqlite3 *db, void *p){
|
||||
if( isLookaside(db, p) ){
|
||||
if( p==0 ){
|
||||
return 0;
|
||||
}else if( isLookaside(db, p) ){
|
||||
return db->lookaside.sz;
|
||||
}else{
|
||||
return sqlite3GlobalConfig.m.xSize(p);
|
||||
|
||||
Reference in New Issue
Block a user