1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Continuing progress on the new memory allocation subsystem. Added the

sqlite3_mem_methods structure for defining new memory allocators at
run-time. (CVS 5219)

FossilOrigin-Name: f00305f4cd2f487f660f34a21c1c24a0b37c7275
This commit is contained in:
drh
2008-06-14 16:56:21 +00:00
parent 40257ffd0a
commit fec00eabb3
10 changed files with 559 additions and 447 deletions

View File

@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.443 2008/06/13 18:24:27 drh Exp $
** $Id: main.c,v 1.444 2008/06/14 16:56:22 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -103,6 +103,7 @@ int sqlite3_initialize(void){
*/
int sqlite3_shutdown(void){
sqlite3_os_end();
sqlite3MallocEnd();
sqlite3_mutex_end();
sqlite3FullInit = 0;
sqlite3IsInit = 0;
@@ -149,14 +150,10 @@ int sqlite3_config(int op, ...){
}
case SQLITE_CONFIG_MALLOC: {
/* Specify an alternative malloc implementation */
sqlite3Config.xMalloc = va_arg(ap, void*(*)(int));
sqlite3Config.xFree = va_arg(ap, void(*)(void*));
sqlite3Config.xRealloc = va_arg(ap, void*(*)(void*,int));
sqlite3Config.xMemsize = va_arg(ap, int(*)(void*));
sqlite3Config.xRoundup = va_arg(ap, int(*)(int));
sqlite3Config.m = *va_arg(ap, sqlite3_mem_methods*);
break;
}
case SQLITE_CONFIG_MEMSTATS: {
case SQLITE_CONFIG_MEMSTATUS: {
/* Enable or disable the malloc status collection */
sqlite3Config.bMemstat = va_arg(ap, int);
break;