1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +03:00

Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree() and

all memory from sqlite3_malloc() is freed by sqlite3_free().

FossilOrigin-Name: ac1f37a647e9ed1c00a901d26d9956a86c40117a
This commit is contained in:
drh
2010-07-24 16:34:37 +00:00
parent 5419ee5f2f
commit b975598ea0
24 changed files with 124 additions and 108 deletions

View File

@@ -2325,7 +2325,7 @@ struct StrAccum {
int nAlloc; /* Amount of space allocated in zText */
int mxAlloc; /* Maximum allowed string length */
u8 mallocFailed; /* Becomes true if any memory allocation fails */
u8 useMalloc; /* True if zText is enlargeable using realloc */
u8 useMalloc; /* 0: none, 1: sqlite3DbMalloc, 2: sqlite3_malloc */
u8 tooBig; /* Becomes true if string size exceeds limits */
};
@@ -3140,9 +3140,10 @@ SQLITE_EXTERN void (*sqlite3IoTrace)(const char*,...);
# define sqlite3MemdebugSetType(X,Y) /* no-op */
# define sqlite3MemdebugHasType(X,Y) 1
#endif
#define MEMTYPE_HEAP 0x01 /* General heap allocations */
#define MEMTYPE_DB 0x02 /* Associated with a database connection */
#define MEMTYPE_SCRATCH 0x04 /* Scratch allocations */
#define MEMTYPE_PCACHE 0x08 /* Page cache allocations */
#define MEMTYPE_HEAP 0x01 /* General heap allocations */
#define MEMTYPE_DB 0x02 /* Associated with a database connection */
#define MEMTYPE_SCRATCH 0x04 /* Scratch allocations */
#define MEMTYPE_PCACHE 0x08 /* Page cache allocations */
#define MEMTYPE_RECURSIVE 0x10 /* Experimental */
#endif /* _SQLITEINT_H_ */