| Index: sql/connection.h
|
| diff --git a/sql/connection.h b/sql/connection.h
|
| index 19592d9f0e44ed68764b9d25a88d9a65424ba9b7..0263bb1cedce5c3a220e643d8b786536f7214ec5 100644
|
| --- a/sql/connection.h
|
| +++ b/sql/connection.h
|
| @@ -262,6 +262,7 @@ class SQL_EXPORT Connection {
|
| // true, this function will try to free all of the cache memory it can. If
|
| // |aggressively| is false, this function will try to cut cache memory
|
| // usage by half.
|
| + // NOTE(shess): See also ReleaseCacheMemory().
|
| void TrimMemory(bool aggressively);
|
|
|
| // Raze the database to the ground. This approximates creating a
|
| @@ -638,6 +639,12 @@ class SQL_EXPORT Connection {
|
| return clock_->Now();
|
| }
|
|
|
| + // Release page-cache memory if memory-mapped I/O is enabled and the database
|
| + // was changed. Passing true for |assume_changed| allows overriding the
|
| + // change detection for cases like DDL (CREATE, DROP, etc), which do not
|
| + // participate in the total-rows-changed tracking.
|
| + void ReleaseCacheMemoryIfNeeded(bool assume_changed);
|
| +
|
| // The actual sqlite database. Will be NULL before Init has been called or if
|
| // Init resulted in an error.
|
| sqlite3* db_;
|
| @@ -679,6 +686,14 @@ class SQL_EXPORT Connection {
|
| // databases.
|
| bool poisoned_;
|
|
|
| + // |true| if SQLite memory-mapped I/O is enabled for this connection.
|
| + // Used by ReleaseCacheMemoryIfNeeded().
|
| + bool mmap_enabled_;
|
| +
|
| + // Used by ReleaseCacheMemoryIfNeeded() to track if new changes have happened
|
| + // since memory was last released.
|
| + int total_changes_;
|
| +
|
| ErrorCallback error_callback_;
|
|
|
| // Tag for auxiliary histograms.
|
|
|