Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Memory to reduce unsafe code #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eduardosm
Copy link
Contributor

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.

@cmpute
Copy link
Owner

cmpute commented Oct 23, 2023

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.

@eduardosm
Copy link
Contributor Author

Since it was only used to allocate slices of Word, I simplified it accordingly. Is there a need to allocate arbitrary layouts?

@cmpute
Copy link
Owner

cmpute commented Dec 19, 2023

This change might be related to #43 , lets wait for that issue to have a rough idea of how to improve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants