Conversation
| return soundBuffer->This.getSamples(); | ||
| } | ||
|
|
||
| size_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer) |
There was a problem hiding this comment.
Any reason for this change? We might need a cast on the return statement, but I think it should still return a size_t.
sfSoundBuffer_getSampleCount is defined as returning a size_t on the D side.
There was a problem hiding this comment.
I made the change here because sf::SoundBuffer::getSampleCount returns a Uint64, not size_t; I forgot to make the change D-side though! I'll fix that now.
There was a problem hiding this comment.
I actually have it as size_t on purpose as I personally think size_t is better to use than ulong. I have been meaning to bring this up on the forums for a long time since I think it is a better design. We have to cast it somewhere anyway since we need it to be a size_t when we make a slice. I figured it might as well be here.
There was a problem hiding this comment.
That's fair. I'll revert the change on my side, then
|
Can you squash this down to a single commit? |
11c11d3 to
680cbe3
Compare
|
Alright! I think that did it (I've never squished a git before, so I had to look up how to do it.) |
|
Looks good! 👍 I'll let it build just in case, but that was exactly what I wanted. |
|
Alrighty! Looks like the appveyor results are in! Soon as you pull, I'll push the button on the D-side. |
|
Go for it! |
Here's the DSFMLC side of the patch that gets rid of allocations when passing string data from the D-side. I'm not incredibly familiar with C++, so I hope just having the std::string() constructors in the call statements isn't bad behavior.
The converse--minimizing or eliminating allocations when passing strings from C++ to D--is beyond my knowledge of C++ and D's underlying memory details; We might be able to do something once D's C++ interop is good enough to handle std::strings.
I've also made a minor change to the way Joystick identification is passed to avoid extraneous allocations D-side.
c.f. Jebbs/DSFML#225