diff options
Diffstat (limited to 'xsig')
-rw-r--r-- | xsig/include/signature_db.hpp | 2 | ||||
-rw-r--r-- | xsig/src/signature_db.cpp | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/xsig/include/signature_db.hpp b/xsig/include/signature_db.hpp index 23e3aae..b98b22a 100644 --- a/xsig/include/signature_db.hpp +++ b/xsig/include/signature_db.hpp @@ -94,6 +94,8 @@ public: std::vector<std::pair<size_t, double>> search_image(const fs::path &path, const populate_cfg_t &cfg, bool insert = false); + int64_t db_memory_usage(); + //disjoint set for keeping similar images in the same group //some of these probably shouldn't be public. TBD... void ds_init(); diff --git a/xsig/src/signature_db.cpp b/xsig/src/signature_db.cpp index 3c4187b..105106b 100644 --- a/xsig/src/signature_db.cpp +++ b/xsig/src/signature_db.cpp @@ -479,6 +479,13 @@ std::vector<std::pair<size_t, double>> signature_db::search_image(const fs::path return ret; } +int64_t signature_db::db_memory_usage() +{ + sqlite3_int64 r, dummy; + sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &r, &dummy, 0); + return static_cast<int64_t>(r); +} + void signature_db::ds_init() { sqlite3_exec(p->db, R"sql( |