Have debugging code handle sqliteMalloc(n) where n<0 in the same way as production. (CVS 2303)

FossilOrigin-Name: ab85e1d01299e383bda1834664370f04b13634b6
This commit is contained in:
danielk1977 2005-02-01 10:35:06 +00:00
parent 161aba32be
commit a38432df12
3 changed files with 12 additions and 12 deletions

View File

@ -1,5 +1,5 @@
C More\sperformance\stweaking\sin\sthe\sparser.\s(CVS\s2302) C Have\sdebugging\scode\shandle\ssqliteMalloc(n)\swhere\sn<0\sin\sthe\ssame\sway\sas\sproduction.\s(CVS\s2303)
D 2005-02-01T04:09:37 D 2005-02-01T10:35:07
F Makefile.in ffd81f5e926d40b457071b4de8d7c1fa18f39b5a F Makefile.in ffd81f5e926d40b457071b4de8d7c1fa18f39b5a
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457 F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1 F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
@ -73,7 +73,7 @@ F src/tokenize.c bbeee5e30019261fe2d36330d2bf70d9d7c3eee9
F src/trigger.c 038c8e128d4551cd016426cd11bbf5c478816481 F src/trigger.c 038c8e128d4551cd016426cd11bbf5c478816481
F src/update.c b6f4668c11059f86b71581187d09197fa28ec4be F src/update.c b6f4668c11059f86b71581187d09197fa28ec4be
F src/utf.c bda5eb85039ef16f2d17004c1e18c96e1ab0a80c F src/utf.c bda5eb85039ef16f2d17004c1e18c96e1ab0a80c
F src/util.c 5bee9b90b542b33ec87cf1225a679b8157d81525 F src/util.c 1b7b9a127b66743ab6cba8d44597aeb570723c99
F src/vacuum.c 1a9db113a027461daaf44724c71dd1ebbd064203 F src/vacuum.c 1a9db113a027461daaf44724c71dd1ebbd064203
F src/vdbe.c 84ccc6be09e13ee5825f32a94b289117cc903ab2 F src/vdbe.c 84ccc6be09e13ee5825f32a94b289117cc903ab2
F src/vdbe.h bb9186484f749a839c6c43953e79a6530253f7cd F src/vdbe.h bb9186484f749a839c6c43953e79a6530253f7cd
@ -272,7 +272,7 @@ F www/tclsqlite.tcl e73f8f8e5f20e8277619433f7970060ab01088fc
F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618 F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
F www/whentouse.tcl 3e522a06ad41992023c80ca29a048ae2331ca5bd F www/whentouse.tcl 3e522a06ad41992023c80ca29a048ae2331ca5bd
P 22041d5f26355b0fc80eb355bfec897fb50ac1e1 P a3d12726bb7bce72b8266236800c07f22ac5212f
R b4a54ea3cafcdb288b43686dac552263 R b57b166e1928ebe0d59a6327104a41fd
U drh U danielk1977
Z 237a2ff17f8375528094b2d5b90c3f47 Z 12bc5af8e1b73a495f7666b7272f68e3

View File

@ -1 +1 @@
a3d12726bb7bce72b8266236800c07f22ac5212f ab85e1d01299e383bda1834664370f04b13634b6

View File

@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing ** This file contains functions for allocating memory, comparing
** strings, and stuff like that. ** strings, and stuff like that.
** **
** $Id: util.c,v 1.129 2005/01/31 12:56:44 danielk1977 Exp $ ** $Id: util.c,v 1.130 2005/02/01 10:35:07 danielk1977 Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include <stdarg.h> #include <stdarg.h>
@ -93,7 +93,7 @@ void *sqlite3Malloc_(int n, int bZero, char *zFile, int line){
k = (n+sizeof(int)-1)/sizeof(int); k = (n+sizeof(int)-1)/sizeof(int);
pi = malloc( (N_GUARD*2+1+k)*sizeof(int)); pi = malloc( (N_GUARD*2+1+k)*sizeof(int));
if( pi==0 ){ if( pi==0 ){
sqlite3_malloc_failed++; if( n>0 ) sqlite3_malloc_failed++;
return 0; return 0;
} }
sqlite3_nMalloc++; sqlite3_nMalloc++;
@ -197,7 +197,7 @@ void *sqlite3Realloc_(void *oldP, int n, char *zFile, int line){
k = (n + sizeof(int) - 1)/sizeof(int); k = (n + sizeof(int) - 1)/sizeof(int);
pi = malloc( (k+N_GUARD*2+1)*sizeof(int) ); pi = malloc( (k+N_GUARD*2+1)*sizeof(int) );
if( pi==0 ){ if( pi==0 ){
sqlite3_malloc_failed++; if( n>0 ) sqlite3_malloc_failed++;
return 0; return 0;
} }
for(i=0; i<N_GUARD; i++) pi[i] = 0xdead1122; for(i=0; i<N_GUARD; i++) pi[i] = 0xdead1122;
@ -304,7 +304,7 @@ void *sqlite3Realloc(void *p, int n){
} }
p2 = realloc(p, n); p2 = realloc(p, n);
if( p2==0 ){ if( p2==0 ){
sqlite3_malloc_failed++; if( n>0 ) sqlite3_malloc_failed++;
} }
return p2; return p2;
} }