Make the use and function of SQLITE_DYNAMIC clearer. Add assert() statement
to help ensure that SQLITE_DYNAMIC is not misused.
FossilOrigin-Name: ab80f2c3b2f1eea6e35989d3e9b6137b51091754
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 9071bef..ba6980d 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -561,9 +561,13 @@
/*
** The following value as a destructor means to use sqlite3DbFree().
-** This is an internal extension to SQLITE_STATIC and SQLITE_TRANSIENT.
+** The sqlite3DbFree() routine requires two parameters instead of the
+** one parameter that destructors normally want. So we have to introduce
+** this magic value that the code knows to handle differently. Any
+** pointer will work here as long as it is distinct from SQLITE_STATIC
+** and SQLITE_TRANSIENT.
*/
-#define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3DbFree)
+#define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3MallocSize)
/*
** When SQLITE_OMIT_WSD is defined, it means that the target platform does