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

mutability of WGPUChainedStruct #22

Open
VarLad opened this issue May 1, 2024 · 5 comments
Open

mutability of WGPUChainedStruct #22

VarLad opened this issue May 1, 2024 · 5 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@VarLad
Copy link
Member

VarLad commented May 1, 2024

Shouldn't WGPUChainedStruct be mutable since a pointer to it is needed in a lot of structs, including itself

struct WGPUChainedStruct
    next::Ptr{WGPUChainedStruct}
    sType::WGPUSType
end
@arhik
Copy link
Member

arhik commented May 3, 2024

Usually LinkedList Datastructure should be mutable for extensibility. Let's reason around it and make changes. Meanwhile if this is a show stopper for you, you can use cStruct like interface to create this struct on heap or use Accessors.jl to create copy for each modification.

@arhik arhik self-assigned this May 3, 2024
@arhik arhik added bug Something isn't working question Further information is requested labels May 3, 2024
@VarLad
Copy link
Member Author

VarLad commented May 3, 2024

There's a chance that we can get it fixed from Clang.jl itself
Lets wait and see. JuliaInterop/Clang.jl#490

@arhik
Copy link
Member

arhik commented May 3, 2024

I was going through clang.jl to find the fix. If they are fixing it upstream themselves, great. Thanks for taking initiative.

@arhik
Copy link
Member

arhik commented May 3, 2024

I guess they will have to check for recursive structure now.

@arhik
Copy link
Member

arhik commented May 3, 2024

I guess they will have to check for recursive structure now.

It's a bug rather. They should generalize Pointer to const structure as mutable 🤔.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants