aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2003-01-12 18:02:16 +0000
committerdrh <drh@noemail.net>2003-01-12 18:02:16 +0000
commited6c8671b342e9b3793e2603e7f098ba4fc092a4 (patch)
tree1243d500342286b978543d20e5c88264cedfa2e5 /src/util.c
parent49f0936ec79dcbdbd80134151658615726643fa1 (diff)
downloadsqlite-ed6c8671b342e9b3793e2603e7f098ba4fc092a4.tar.gz
sqlite-ed6c8671b342e9b3793e2603e7f098ba4fc092a4.zip
Initial check-in of the code for the new sqlite_set_authorizer() API function.
The code is mostly untested at this point. (CVS 827) FossilOrigin-Name: 52d5007f64d0af5286b2a0e1f0b9e53c86bece3f
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index 3d47bbaf6..7e4e72f58 100644
--- a/src/util.c
+++ b/src/util.c
@@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
-** $Id: util.c,v 1.54 2003/01/02 14:43:57 drh Exp $
+** $Id: util.c,v 1.55 2003/01/12 18:02:19 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@@ -85,6 +85,24 @@ void *sqliteMalloc_(int n, int bZero, char *zFile, int line){
}
/*
+** Check to see if the given pointer was obtained from sqliteMalloc()
+** and is able to hold at least N bytes. Raise an exception if this
+** is not the case.
+**
+** This routine is used for testing purposes only.
+*/
+void sqliteCheckMemory(void *p, int N){
+ int *pi = p;
+ int n, k;
+ pi -= 2;
+ assert( pi[0]==0xdead1122 );
+ n = pi[1];
+ assert( N>=0 && N<n );
+ k = (n+sizeof(int)-1)/sizeof(int);
+ assert( pi[k+2]==0xdead3344 );
+}
+
+/*
** Free memory previously obtained from sqliteMalloc()
*/
void sqliteFree_(void *p, char *zFile, int line){