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

Don't box block descriptors #17

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

Conversation

TellowKrinkle
Copy link

Switches block descriptors to const globals, so we don't have to heap allocate a new one for each block

Also deduplicates copy functions (since they're all the same) and completely removes the copy and dispose functions for blocks implementing Copy

Note: I had to change the descriptor function signatures to use *mut c_void/*const c_void because otherwise the compiler complains. An alternative is forcing all the block parameters to be 'static.

Copy link

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks good to me.

For reference, I've done most of these improvements in my fork block2 as well. Good idea with the mem::needs_drop check, I'll probably incorporate that.

@madsmtm madsmtm mentioned this pull request Nov 4, 2022
80 tasks
@madsmtm madsmtm mentioned this pull request Sep 3, 2023
11 tasks
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.

2 participants