I'm starting to wonder what good
&mut self on all the
Alloc method does. Especially when it's renamed to
AllocHandle, what does it mean to use a mutable reference to a handle?
I also have a hard time coming up with a scenario where
&self wouldn’t work or make things harder. OTOH, are there cases where it would make things easier?
I wouldn't have to get a mutable ref in the code I'm writing right now.
Can you share that code? I’m curious in what kind of situation it makes a difference
Essentially my handle is an integer, and it's used to call into the moz_arena_* functions in mozjemalloc.
and I have a global for the id of the default arena
So the thing, really, is that
&mut self makes sense for the implementation of the allocator itself. And
&self for the handle.
where, in fact, for the handle type, we don't really need everything... we only need something that gets us a &mut Alloc
which circles back to the