1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Continuing work on the new memory allocation subsystem.

Added routines for temporary memory allocation.  Right the btree
balance mechanism to only do one temporary allocation at a time. (CVS 5220)

FossilOrigin-Name: 65fe7b62cfe7d11cd667681a64c96fe7b2fe5685
This commit is contained in:
drh
2008-06-15 02:51:47 +00:00
parent fec00eabb3
commit e5ae5735c0
26 changed files with 208 additions and 142 deletions

View File

@@ -12,7 +12,7 @@
** This is the implementation of generic hash-tables
** used in SQLite.
**
** $Id: hash.c,v 1.28 2008/05/13 13:27:34 drh Exp $
** $Id: hash.c,v 1.29 2008/06/15 02:51:47 drh Exp $
*/
#include "sqliteInt.h"
#include <assert.h>
@@ -387,10 +387,10 @@ void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, void *data){
}
}
if( data==0 ) return 0;
new_elem = (HashElem*)sqlite3_malloc( sizeof(HashElem) );
new_elem = (HashElem*)sqlite3Malloc( sizeof(HashElem) );
if( new_elem==0 ) return data;
if( pH->copyKey && pKey!=0 ){
new_elem->pKey = sqlite3_malloc( nKey );
new_elem->pKey = sqlite3Malloc( nKey );
if( new_elem->pKey==0 ){
sqlite3_free(new_elem);
return data;