gecko-dev/xpcom
Andrew McCreight cdd79677c6 Bug 1794645 - Use usize for refcounting non-atomic Rust XPCOM objects. r=nika
This matches the implementation of refcounting in C++ XPCOM objects.
We'll end up crashing if the refcount being returned is too large.

Change inc() and dec() to use try_into instead of as. This will change
the behavior because we'll crash if the value is too large instead of
silently truncating the return value, which might be worse because few
callers actually use the return value, but is unlikely to matter.

Also, use a more precise return type for the get() methods. It is only
used by Rust code, so there's no need to be compatible with
nsISupports. I made that change here to avoid needing to add a coercion
from usize to nsrefcnt.

Part of my goal with this patch is to eliminate an unnecessary use of
nsrefcnt from Rust.

Differential Revision: https://phabricator.services.mozilla.com/D159124
2022-10-13 14:53:08 +00:00
..
base Backed out 2 changesets (bug 1792567) for causing build bustages on GMPParent.cpp CLOSED TREE 2022-10-12 14:51:46 -04:00
build Backed out 2 changesets (bug 1792567) for causing build bustages on GMPParent.cpp CLOSED TREE 2022-10-12 14:51:46 -04:00
components Bug 1792437, part 2 - Remove nsIModule. r=xpcom-reviewers,nika 2022-09-27 22:16:29 +00:00
docs Bug 1788671 - Document how to add Services to eslint. r=Standard8 DONTBUILD 2022-10-07 18:11:17 +00:00
ds Backed out 15 changesets (bug 1794001, bug 1793995, bug 1693271) for causing build bustages CLOSED TREE 2022-10-12 22:12:26 -04:00
geckoprocesstypes_generator Bug 1751948 - Part 6: Add basic support for running IPDL unit tests during gtest, r=ipc-reviewers,andi,handyman 2022-02-28 21:01:49 +00:00
glue Bug 1774864 - Cleanup xpcom/ includes r=sylvestre 2022-06-24 07:13:59 +00:00
idl-parser Bug 1792357, part 1 - [infallible] is okay if the interface isn't scriptable. r=xpcom-reviewers,nika 2022-09-27 18:31:50 +00:00
io Bug 1791029 - Deal with lstat potentially lying in nsLocalFileUnix. r=xpcom-reviewers,nika 2022-10-06 23:29:18 +00:00
reflect Bug 1778211 - Reject xpidl CDATA containing 'virtual', r=xpcom-reviewers,necko-reviewers,mccr8,dragana 2022-07-06 14:53:06 +00:00
rust Bug 1794645 - Use usize for refcounting non-atomic Rust XPCOM objects. r=nika 2022-10-13 14:53:08 +00:00
string Backed out 15 changesets (bug 1794001, bug 1793995, bug 1693271) for causing build bustages CLOSED TREE 2022-10-12 22:12:26 -04:00
system Bug 1782981 - Only show the macOS context menu if it is supported; r=nordzilla 2022-08-17 15:41:12 +00:00
tests Backed out 15 changesets (bug 1794001, bug 1793995, bug 1693271) for causing build bustages CLOSED TREE 2022-10-12 22:12:26 -04:00
threads Bug 1794012 - Add a static main thread capability for the thread safety analysis, r=xpcom-reviewers,kmag 2022-10-11 23:06:08 +00:00
windbgdlg
xpidl
moz.build
xpcom-config.h.in