Index: sql/connection.h |
diff --git a/sql/connection.h b/sql/connection.h |
index 19592d9f0e44ed68764b9d25a88d9a65424ba9b7..d456b6cd88c9627b488c970dcd46de4a72c7945a 100644 |
--- a/sql/connection.h |
+++ b/sql/connection.h |
@@ -146,6 +146,9 @@ class SQL_EXPORT Connection { |
// other platforms. |
void set_restrict_to_user() { restrict_to_user_ = true; } |
+ // Call to opt out of memory-mapped file I/O. |
+ void set_mmap_disabled() { mmap_disabled_ = true; } |
+ |
// Set an error-handling callback. On errors, the error number (and |
// statement, if available) will be passed to the callback. |
// |
@@ -638,6 +641,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 |implicit_change_performed| 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 implicit_change_performed); |
+ |
// The actual sqlite database. Will be NULL before Init has been called or if |
// Init resulted in an error. |
sqlite3* db_; |
@@ -679,6 +688,17 @@ class SQL_EXPORT Connection { |
// databases. |
bool poisoned_; |
+ // |true| if SQLite memory-mapped I/O is not desired for this connection. |
+ bool mmap_disabled_; |
+ |
+ // |true| if SQLite memory-mapped I/O was 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_at_last_release_; |
+ |
ErrorCallback error_callback_; |
// Tag for auxiliary histograms. |