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

Add evidence mark comments to source code. Add additional information to the

documentation of sqlite3_release_memory().  Fix a minor inefficiency in mem1.c
that was discovered while writing requirements tests.

FossilOrigin-Name: 53b0c03fd33d2d8141fd386de5493fec64456042
This commit is contained in:
drh
2010-08-31 15:27:32 +00:00
parent 18ec96b3a3
commit 9f129f467e
11 changed files with 79 additions and 26 deletions

View File

@@ -62,12 +62,13 @@ void sqlite3_soft_heap_limit(int n){
*/
int sqlite3_release_memory(int n){
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
int nRet = 0;
nRet += sqlite3PcacheReleaseMemory(n-nRet);
return nRet;
return sqlite3PcacheReleaseMemory(n);
#else
/* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
** is a no-op returning zero if SQLite is not compiled with
** SQLITE_ENABLE_MEMORY_MANAGEMENT. */
UNUSED_PARAMETER(n);
return SQLITE_OK;
return 0;
#endif
}
@@ -511,6 +512,9 @@ void *sqlite3Realloc(void *pOld, int nBytes){
return 0;
}
nOld = sqlite3MallocSize(pOld);
/* IMPLEMENTATION-OF: R-46199-30249 SQLite guarantees that the second
** argument to xRealloc is always a value returned by a prior call to
** xRoundup. */
nNew = sqlite3GlobalConfig.m.xRoundup(nBytes);
if( nOld==nNew ){
pNew = pOld;