Bug 798914 (part 1) - Introduce mozilla::MallocSizeOf in mfbt. r=Waldo.
authorCatalin Iacob <iacobcatalin@gmail.com>
Sun, 23 Jun 2013 12:57:47 +0200
changeset 148645 d8f504ac6b83040699e90f5384186a7f5c41a6da
parent 148625 6e091ce775ef358ff4dbadb162ddc807350bd210
child 148646 b77a391ef1fbfa393f06bf144831fdf9a0b43b54
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs798914
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 798914 (part 1) - Introduce mozilla::MallocSizeOf in mfbt. r=Waldo.
mfbt/MemoryReporting.h
mfbt/exported_headers.mk
new file mode 100644
--- /dev/null
+++ b/mfbt/MemoryReporting.h
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/* Memory reporting infrastructure. */
+
+#ifndef mozilla_MemoryReporting_h_
+#define mozilla_MemoryReporting_h_
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+
+namespace mozilla {
+
+/*
+ * This is for functions that are like malloc_usable_size.  Such functions are
+ * used for measuring the size of data structures.
+ */
+typedef size_t (*MallocSizeOf)(const void* p);
+
+} /* namespace mozilla */
+
+#endif /* __cplusplus */
+
+typedef size_t (*MozMallocSizeOf)(const void* p);
+
+#endif /* mozilla_MemoryReporting_h_ */
--- a/mfbt/exported_headers.mk
+++ b/mfbt/exported_headers.mk
@@ -24,16 +24,17 @@ EXPORTS_mozilla += \
   EnumSet.h \
   FloatingPoint.h \
   GuardObjects.h \
   HashFunctions.h \
   Likely.h \
   LinkedList.h \
   MathAlgorithms.h \
   MemoryChecking.h \
+  MemoryReporting.h \
   MSStdInt.h \
   NullPtr.h \
   PodOperations.h \
   Poison.h \
   Range.h \
   RangedPtr.h \
   RefPtr.h \
   Scoped.h \