The existing implementation uses a direct pointer for tracked struct data. This is maximally efficient but not safe. To make it safe, we would need to have a cheap way to ensure that the tracked struct has not been deleted -- this could only happen if user's "leak" data to bypass salsa's dependency tracking, but unfortunately that is possible without triggering UB (though it does require safe code). One way to do this would be to use arenas to allocate tracked struct storage. But another option is to first try using the sharded slab create -- while not maximally efficient, it presents us a safe interface to build on and may be "fast enough". We can explore future refinements later.
The existing implementation uses a direct pointer for tracked struct data. This is maximally efficient but not safe. To make it safe, we would need to have a cheap way to ensure that the tracked struct has not been deleted -- this could only happen if user's "leak" data to bypass salsa's dependency tracking, but unfortunately that is possible without triggering UB (though it does require safe code). One way to do this would be to use arenas to allocate tracked struct storage. But another option is to first try using the sharded slab create -- while not maximally efficient, it presents us a safe interface to build on and may be "fast enough". We can explore future refinements later.