Skip to content

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