Skip to content

Allocgate #10052

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

Closed
leecannon opened this issue Oct 28, 2021 · 1 comment · Fixed by #10055
Closed

Allocgate #10052

leecannon opened this issue Oct 28, 2021 · 1 comment · Fixed by #10055
Labels
breaking Implementing this issue could cause existing code to no longer compile or have different behavior. enhancement Solving this issue will likely involve adding new logic or components to the codebase. optimization standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@leecannon
Copy link
Contributor

It was noticed in #10037 that LLVM is not able to properly optimize interfaces that use @fieldParentPtr as per @SpexGuy's comment.

The Random interface was changed in #10045 to instead use a type erased pointer in place of @fieldParentPointer resulting in significant performance improvement.

This issue is to track applying the same change to Allocator, however due to this interface being much more widely used it is planned to be merged just before the 0.9.0 release.

Soon I will open a draft PR to begin working on this.

@andrewrk andrewrk added breaking Implementing this issue could cause existing code to no longer compile or have different behavior. enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library. labels Oct 28, 2021
@andrewrk andrewrk added this to the 0.9.0 milestone Oct 28, 2021
@andrewrk andrewrk changed the title Refactor Allocator interface Allocgate Oct 28, 2021
@leecannon leecannon mentioned this issue Oct 29, 2021
@iacore
Copy link
Contributor

iacore commented Nov 20, 2021

I think we should add a unified way for implementing polymorphism while we are at it. #10184

DaJobat pushed a commit to DaJobat/dnns-from-scratch-in-zig that referenced this issue Apr 25, 2023
Allocators are now passed around by value, as per ziglang/zig#10052
Also renamed destruct methods to deinit, as this is more idiomatic zig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Implementing this issue could cause existing code to no longer compile or have different behavior. enhancement Solving this issue will likely involve adding new logic or components to the codebase. optimization standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants