-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove MemoryHelper
#7335
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
Remove MemoryHelper
#7335
Conversation
|
I've found out just now that |
DomClark
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no reason for these buffers to be aligned in the first place, so I'd simply replace the aligned allocations with normal ones.
In the future, if we want to make an aligned allocation, it would be better to use the aligned versions of operator new and operator delete, which are more idiomatic in C++ code and supported on all platforms. Ideally we would wrap these in a custom allocator, so we can use standard library containers instead of manually allocating arrays on the heap.
I didn't wanted to introduce any behaviour changes. Also, i have little knowledge on what might break so did the change with minimum cover. If someone wants to refactor, it's completely fine with me. I am just afraid of breaking something unexpected in the process. If aligning can be removed safely, then it would be better, saving some code and also makes it easier to get into it at a future time. But like i said, something might break somewhere unexpectedly. |
|
I had a look and I'm fairly sure nothing will break. Do test it yourself, though. |
Co-authored-by: saker <[email protected]>
|
You need to also change the type of the variables |
|
I was looking for what caused the error. Thanks for this hint |
|
|
learned that the hard way |
sakertooth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend compiling your changes to see if they work or not before pushing them.
This reverts commit eadcc55.
sakertooth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be sure to test to see if you can start lmms fine now, just in case.
|
I can start lmms fine and ran greppi - krem kakkuja and dirtylove projects for 1 - 2 mins each. |
* remove memory helper and replace alignedMalloc with stl version * it's aligned_alloc * forgot about destructor * switch to unique pointers Co-authored-by: saker <[email protected]> * compile fix --------- Co-authored-by: saker <[email protected]>
MemoryHelpercontains 1 functionalignedMallocwhich is used in onlyAudioEngine. Removed the usage and cleaned up the variables previously using the function to use unique pointers.