diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-05-31 09:45:25 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-05-31 09:45:25 +0200 |
commit | 2d4ff8df91414b42974c72b2870f5c6e9ad397a8 (patch) | |
tree | 15b23dc6494a147e723cfdb3765be1568cf6c113 /storage | |
parent | f4b8be889cb7ee31a62af5660f36aaa192599009 (diff) | |
parent | 14eb8dc7bee8670e39d1199591d335579601f2ad (diff) | |
download | UXP-2d4ff8df91414b42974c72b2870f5c6e9ad397a8.tar UXP-2d4ff8df91414b42974c72b2870f5c6e9ad397a8.tar.gz UXP-2d4ff8df91414b42974c72b2870f5c6e9ad397a8.tar.lz UXP-2d4ff8df91414b42974c72b2870f5c6e9ad397a8.tar.xz UXP-2d4ff8df91414b42974c72b2870f5c6e9ad397a8.zip |
Merge branch 'master' into Basilisk-release
Diffstat (limited to 'storage')
-rw-r--r-- | storage/TelemetryVFS.cpp | 12 | ||||
-rw-r--r-- | storage/mozStorageService.cpp | 52 |
2 files changed, 0 insertions, 64 deletions
diff --git a/storage/TelemetryVFS.cpp b/storage/TelemetryVFS.cpp index f4f28b36c..5a025e29e 100644 --- a/storage/TelemetryVFS.cpp +++ b/storage/TelemetryVFS.cpp @@ -110,18 +110,6 @@ public: // We don't report SQLite I/O on Windows because we have a comprehensive // mechanism for intercepting I/O on that platform that captures a superset // of the data captured here. -#if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(XP_WIN) - if (IOInterposer::IsObservedOperation(op)) { - const char* main_ref = "sqlite-mainthread"; - const char* other_ref = "sqlite-otherthread"; - - // Create observation - IOInterposeObserver::Observation ob(op, start, end, - (mainThread ? main_ref : other_ref)); - // Report observation - IOInterposer::Report(ob); - } -#endif /* defined(MOZ_ENABLE_PROFILER_SPS) && !defined(XP_WIN) */ } private: diff --git a/storage/mozStorageService.cpp b/storage/mozStorageService.cpp index 4f288ad42..8c6f65232 100644 --- a/storage/mozStorageService.cpp +++ b/storage/mozStorageService.cpp @@ -36,9 +36,6 @@ #ifdef MOZ_STORAGE_MEMORY # include "mozmemory.h" -# ifdef MOZ_DMD -# include "DMD.h" -# endif #endif //////////////////////////////////////////////////////////////////////////////// @@ -59,10 +56,6 @@ namespace storage { //////////////////////////////////////////////////////////////////////////////// //// Memory Reporting -#ifdef MOZ_DMD -static mozilla::Atomic<size_t> gSqliteMemoryUsed; -#endif - static int64_t StorageSQLiteDistinguishedAmount() { @@ -165,13 +158,6 @@ Service::CollectReports(nsIHandleReportCallback *aHandleReport, NS_LITERAL_CSTRING("schema"), schemaDesc, SQLITE_DBSTATUS_SCHEMA_USED, &totalConnSize); } - -#ifdef MOZ_DMD - if (::sqlite3_memory_used() != int64_t(gSqliteMemoryUsed)) { - NS_WARNING("memory consumption reported by SQLite doesn't match " - "our measurements"); - } -#endif } int64_t other = ::sqlite3_memory_used() - totalConnSize; @@ -410,58 +396,20 @@ namespace { // from the standard ones -- they use int instead of size_t. But we don't need // a wrapper for free. -#ifdef MOZ_DMD - -// sqlite does its own memory accounting, and we use its numbers in our memory -// reporters. But we don't want sqlite's heap blocks to show up in DMD's -// output as unreported, so we mark them as reported when they're allocated and -// mark them as unreported when they are freed. -// -// In other words, we are marking all sqlite heap blocks as reported even -// though we're not reporting them ourselves. Instead we're trusting that -// sqlite is fully and correctly accounting for all of its heap blocks via its -// own memory accounting. Well, we don't have to trust it entirely, because -// it's easy to keep track (while doing this DMD-specific marking) of exactly -// how much memory SQLite is using. And we can compare that against what -// SQLite reports it is using. - -MOZ_DEFINE_MALLOC_SIZE_OF_ON_ALLOC(SqliteMallocSizeOfOnAlloc) -MOZ_DEFINE_MALLOC_SIZE_OF_ON_FREE(SqliteMallocSizeOfOnFree) - -#endif - static void *sqliteMemMalloc(int n) { void* p = ::malloc(n); -#ifdef MOZ_DMD - gSqliteMemoryUsed += SqliteMallocSizeOfOnAlloc(p); -#endif return p; } static void sqliteMemFree(void *p) { -#ifdef MOZ_DMD - gSqliteMemoryUsed -= SqliteMallocSizeOfOnFree(p); -#endif ::free(p); } static void *sqliteMemRealloc(void *p, int n) { -#ifdef MOZ_DMD - gSqliteMemoryUsed -= SqliteMallocSizeOfOnFree(p); - void *pnew = ::realloc(p, n); - if (pnew) { - gSqliteMemoryUsed += SqliteMallocSizeOfOnAlloc(pnew); - } else { - // realloc failed; undo the SqliteMallocSizeOfOnFree from above - gSqliteMemoryUsed += SqliteMallocSizeOfOnAlloc(p); - } - return pnew; -#else return ::realloc(p, n); -#endif } static int sqliteMemSize(void *p) |