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

add bindFunc template #16

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

add bindFunc template #16

wants to merge 3 commits into from

Conversation

dushibaiyu
Copy link

Use the template,
Not write cast(void **)&fun

@mdparker
Copy link
Member

This is something I'll look for the next version of DerelictUtil, which I'm currently working on.

@dushibaiyu
Copy link
Author

loadSymbols maybe can use the template and mixin to auto generate code.

@mdparker
Copy link
Member

Yeah, maybe. This isn't a real pressing issue for me, though.

@dushibaiyu
Copy link
Author

what is the pressing issue?

@mdparker
Copy link
Member

Nothing, really. My priority right now is finishing off my refactor of DerelictGL3 and then updating all of the Derelict packages to use the upcoming DerelictUtil 3.0. I simply mean there's no important reason to merge this and tag a new release of the current version of DerelictUtil. It's an enhancement, not a bug fix. And I'm not even sure it's worth doing.

When I can make the time, I'll try this out locally on my 3.0 branch and transform one of the other packages to use it. With your implementation, I'm worried about code bloat from all the multiple instantiations of the template. Derelict 2 used a templated function like this and I intentionally changed it to the current implementation in Derelict 3. Getting rid of the cast to void** isn't much of a benefit if there's a marked increase in the binary. But I'm willing to play around with it and see where it leads me.

@dushibaiyu
Copy link
Author

it can try.
I add buildhrper.
and the test :
https://github.com/putaolabs/DerelictPQ/blob/master/source/derelict/pq/functiond.d
https://github.com/putaolabs/DerelictPQ/blob/master/source/derelict/pq/package.d

in loadSymbols() only two line code:

import derelict.util.buildhelper;
mixin(BuildLoadSymbols!(derelict.pq.functiond));

@mdparker
Copy link
Member

The point is, I'm not going to be merging this into the current release at all. After I experiment with it for myself, I will add it to DerelictUtil 3.0 and update all of the packages to use it iff I determine there is nothing deterimental in doing so. I don't have time to investigate right now, but it is on my TODO list and I will keep this open until I can make time for it.

@dushibaiyu
Copy link
Author

ok.

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