mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
If memory is leaked when running a test script with the --malloctrace option, write out a file called leaks.sql in the same format as mallocs.sql containing th e leaked applications. The same tools can then be used to examine the stack traces associated with leaked allocations. (CVS 4926)
FossilOrigin-Name: f1b97ed93183378ff56b4fe7ae8ea269c24092fc
This commit is contained in:
11
src/mem2.c
11
src/mem2.c
@@ -12,7 +12,7 @@
|
||||
** This file contains the C functions that implement a memory
|
||||
** allocation subsystem for use by SQLite.
|
||||
**
|
||||
** $Id: mem2.c,v 1.23 2008/03/21 14:22:44 danielk1977 Exp $
|
||||
** $Id: mem2.c,v 1.24 2008/03/28 07:42:54 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -410,6 +410,15 @@ void sqlite3MemdebugSettitle(const char *zTitle){
|
||||
sqlite3_mutex_leave(mem.mutex);
|
||||
}
|
||||
|
||||
void sqlite3MemdebugSync(){
|
||||
struct MemBlockHdr *pHdr;
|
||||
for(pHdr=mem.pFirst; pHdr; pHdr=pHdr->pNext){
|
||||
void **pBt = (void**)pHdr;
|
||||
pBt -= pHdr->nBacktraceSlots;
|
||||
mem.xBacktrace(pHdr->iSize, pHdr->nBacktrace-1, &pBt[1]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Open the file indicated and write a log of all unfreed memory
|
||||
** allocations into that log.
|
||||
|
||||
Reference in New Issue
Block a user