Skip to content

Conversation

@leecannon
Copy link
Contributor

@leecannon leecannon commented Dec 18, 2021

Reimplement reallocBytes after regression from #9394/#10112
Also adds an analogous allocBytes function.

@silversquirl / @mlugg: do these functions satisfy your requirements?
As the these functions don't return a slice with the alignment as part of the type I choose not to name them something like reallocAdvancedWithRetAddrRuntimeAlignment to seperate them from the other alloc/realloc functions.

closes #10348

@mlugg
Copy link
Member

mlugg commented Dec 18, 2021

Quickly skimming through, it looks like that should be fine for my use case yeah. Thanks!

Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

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

Thanks for the patch!

Needs simple test coverage and then it's good to go.

@leecannon
Copy link
Contributor Author

Tests added

@leecannon leecannon requested a review from andrewrk December 19, 2021 00:27
Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

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

Thank you 👍

@andrewrk andrewrk merged commit 16b7535 into ziglang:master Dec 19, 2021
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.

Allocgate missing runtime-known alignment functions

3 participants