gecko-dev/xpcom
Andrew McCreight d6f0453414 Bug 1350729 - Implement fake refcount logging for nsFakeStringBuffer. r=dbaron
Running with XPCOM_MEM_LOG_CLASSES=nsStringBuffer triggers an
assertion in refcount logging for nsFakeStringBuffers. These are given
an initial refcount of 1, without calling NS_LOG_ADDREF. Then,
AddRef() is called on these objects in StaticAtom::StaticAtom(), and
we tell the refcount logging system about the fake buffer, and that it
has a refcount of 0, triggering the assertion.

The first part of the fix is to call NS_LOG_ADDREF for this initial
refcount, in StaticAtom().

This first fix causes refcount logging to start reporting that the
fake string buffers leak, when XPCOM_MEM_LOG_CLASSES is not set. This
is because refcount logging is now getting told about these objects
being AddRefed at 1, which it takes to mean that an object is created.

To work around this issue, I add an array gFakeBuffers that contains
every fake string buffer we create, and tell the refcount logging
system that these objects are all being destroyed, when the atom table
is being shut down. This could result in some bogosity if the fake
buffers are "leaked" but hopefully this is still an improvement over
the current state.

MozReview-Commit-ID: 5AxoBYAlYRU

--HG--
extra : rebase_source : ba0763cb494894918141774025db525cea9f9c75
2017-07-14 10:20:23 -07:00
..
base Bug 1350958 - Finish labeling ProxyReleaseEvent, r=billm 2017-07-14 08:49:22 +02:00
build merge mozilla-inbound to mozilla-central a=merge 2017-07-07 10:35:44 +02:00
components Bug 1366878 - Fix nsComponentManager::GetClassObjectByContractID logging. r=erahm 2017-07-03 14:37:06 -07:00
doc
ds Bug 1350729 - Implement fake refcount logging for nsFakeStringBuffer. r=dbaron 2017-07-14 10:20:23 -07:00
glue Bug 1332639 followup. I apparently didn't actually remove the nsStringAPI.* files, but that was the intention, r=oops 2017-03-02 09:23:08 -05:00
idl-parser Bug 1366869 - Make DISPATCH_NORMAL be the default flags argument for nsIEventTarget::Dispatch (r=froydnj) 2017-05-23 12:05:43 -07:00
io Bug 1380165 Part 1: Remove no-longer-used NS_MACOSX_JAVA2_PLUGIN_DIR variable and a comment that referenced a closed bug that conditionally used it. r=mstange 2017-07-12 14:01:12 -07:00
libxpt/xptcall
reflect Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
rust Bug 1343715 - Split nsTSubstring::mFlags into separate variables for class and data flags (rust bindings changes). r=mystor 2017-07-10 12:23:11 -07:00
string Backed out changeset a5c0a74876ae (bug 1376323) for causing bug 1379578 2017-07-13 16:24:26 +02:00
system Bug 1377538: Store blocklistState and blocklistURL in the add-ons DB. r=rhelmer 2017-07-03 18:05:52 -07:00
tests Bug 1380665 - Define MOZ_CODE_COVERAGE for the entire tree. r=jmaher 2017-07-13 19:12:23 +02:00
threads Bug 1350958 - Finish labeling ProxyReleaseEvent, r=billm 2017-07-14 08:49:22 +02:00
typelib Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
windbgdlg
xpidl
moz.build
xpcom-config.h.in
xpcom-private.h.in