Refactor `Memory` to reduce unsafe code
Refactor Memory to avoid dealing with manual allocations, raw pointers and memory layouts.
Now it uses a Vec (with length zero and desired capacity) and Vec::spare_capacity_mut to access the allocated capacity.
Thanks for the PR! What necessitates this change in your opinion? I think the original author of the memory allocation utilities (i.e tczajka) keeps this design because it will be easier to create customized allocation logics in future.
Since it was only used to allocate slices of Word, I simplified it accordingly. Is there a need to allocate arbitrary layouts?
This change might be related to #43 , lets wait for that issue to have a rough idea of how to improve this.