|
|
|
|
|
by mikepurvis
248 days ago
|
|
I don't even think unsafe is necessary for (1), just a custom allocator, as I suggested in a sibling comment. For 2, I believe the pattern would be to make a generic version of the data structure as its own crate, with all the required unsafe stuff in there, properly tested and hidden behind a safe interface. Obviously that does require the data structure to be well defined and for you to know upfront what all the internal references and transformations are going to need to be (but honestly... it's probably good for that to be the case regardless). |
|