aboutsummaryrefslogtreecommitdiff
path: root/src/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hash.c')
-rw-r--r--src/hash.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/hash.c b/src/hash.c
index fd1ceba98..e917197d6 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -12,7 +12,7 @@
** This is the implementation of generic hash-tables
** used in SQLite.
**
-** $Id: hash.c,v 1.21 2007/08/16 10:09:03 danielk1977 Exp $
+** $Id: hash.c,v 1.22 2007/08/29 12:31:26 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <assert.h>
@@ -222,6 +222,14 @@ static void rehash(Hash *pH, int new_size){
int (*xHash)(const void*,int); /* The hash function */
assert( (new_size & (new_size-1))==0 );
+
+ /* There is a call to sqlite3_malloc() inside rehash(). If there is
+ ** already an allocation at pH->ht, then if this malloc() fails it
+ ** is benign (since failing to resize a hash table is a performance
+ ** hit only, not a fatal error).
+ */
+ sqlite3MallocBenignFailure(pH->htsize>0);
+
new_ht = (struct _ht *)sqlite3MallocZero( new_size*sizeof(struct _ht) );
if( new_ht==0 ) return;
if( pH->ht ) sqlite3_free(pH->ht);