mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
d4f517f3e2
Currently lookupOrAdd() will allocate if the table has no storage. But it doesn't report an error if the allocation fails, which can cause problems. This patch changes things so that lookupOrAdd() doesn't allocate when the table has no storage. Instead, it returns an AddPtr that is not *valid* (its mTable is empty) but it is *live*, and can be used in add(), whereupon the allocation will occur. The patch also makes Ptr::isValid() and AddPtr::isValid() non-public, because the valid vs. live distinction is non-obvious and best kept hidden within the classes. --HG-- extra : rebase_source : 95d58725d92cc83332e27a61f98fa61185440e26 |
||
---|---|---|
.. | ||
ductwork/debugger | ||
examples | ||
ipc | ||
public | ||
rust | ||
src | ||
xpconnect | ||
app.mozbuild | ||
ffi.configure | ||
moz.build | ||
moz.configure |