diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-05-23 16:31:42 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-05-23 16:31:42 +0200 |
commit | fcd7ee3c886c435f178230b13d0b0cb0c9c40c53 (patch) | |
tree | abfa8d9a272d739ffe2d92bfcf57d9fd5f7e5157 /storage/mozStorageService.cpp | |
parent | 612459488e5810335c493c467c239c40787cc1d3 (diff) | |
download | UXP-fcd7ee3c886c435f178230b13d0b0cb0c9c40c53.tar UXP-fcd7ee3c886c435f178230b13d0b0cb0c9c40c53.tar.gz UXP-fcd7ee3c886c435f178230b13d0b0cb0c9c40c53.tar.lz UXP-fcd7ee3c886c435f178230b13d0b0cb0c9c40c53.tar.xz UXP-fcd7ee3c886c435f178230b13d0b0cb0c9c40c53.zip |
Remove the Dark Matter Detector (DMD) Memeory debugger component.
This resolves #376.
Diffstat (limited to 'storage/mozStorageService.cpp')
-rw-r--r-- | storage/mozStorageService.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
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) |