Closed kyren closed 1 year ago
If anyone has better names than CollectRefCell
and CollectCell
I'm all ears.
Instead of having a separate method for each unsafe operation on each cell type, I'd propose just providing a single method:
unsafe fn as_(ref_)cell(&self) -> &(Ref)Cell<T>;
This is slightly more verbose to use, but IMHO, it has two advantages:
Cell/RefCell
, not just those we explicitely support;If anyone has better names than
CollectRefCell
andCollectCell
I'm all ears.
Some suggestions:
Lock/RefLock
: this is what I'm using in my gc-extra
experiment;Jail/RefJail
: cute variation on Cell
;FrozenCell/FrozenRefCell
: a little verbose, but maybe more explicit?
These types are generally useful, even if they require unsafe to be useful.
It's nice to not have to manually make an unsafe
Collect
impl, rather than only having to remember to trigger a write barrier.