mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 833609 - Part 1: add a manual call to shrink memory usage to Sqlite.jsm. r=mak
This commit is contained in:
parent
6c1628be1c
commit
640049a53f
@ -586,6 +586,15 @@ OpenedConnection.prototype = Object.freeze({
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Free up as much memory from the underlying database connection as possible.
|
||||
*
|
||||
* @return Promise<>
|
||||
*/
|
||||
shrinkMemory: function () {
|
||||
return this.execute("PRAGMA shrink_memory");
|
||||
},
|
||||
|
||||
_executeStatement: function (sql, statement, params, onRow) {
|
||||
if (statement.state != statement.MOZ_STORAGE_STATEMENT_READY) {
|
||||
throw new Error("Statement is not ready for execution.");
|
||||
|
@ -323,3 +323,12 @@ add_task(function test_detect_multiple_transactions() {
|
||||
yield c.close();
|
||||
});
|
||||
|
||||
add_task(function test_shrink_memory() {
|
||||
let c = yield getDummyDatabase("shrink_memory");
|
||||
|
||||
// It's just a simple sanity test. We have no way of measuring whether this
|
||||
// actually does anything.
|
||||
|
||||
yield c.shrinkMemory();
|
||||
yield c.close();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user