-
Notifications
You must be signed in to change notification settings - Fork 69
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: AnimationCurve support #110
Conversation
|
Yes, it's definitely better from a memory consumption perspective. However, returns to the pool are somewhat complex to incorporate into current implementations, and there is a risk of double returns. (This can be avoided by adding some checks, but it will reduce performance during creation.)
I think FunctionPointer and NativeAnimationCurve should be kept in separate fields. In particular, the delegates generated by FuncitonPointer need to be cached if Burst is not used, and handling them with a single pointer complicates this process. The concern is that the structure size will increase, but this shouldn't be a problem since MotionData is originally a huge struct and was designed to avoid copying. |
My main concern with this implementation is the risk of memory leaks and double freeing. They have passed minimal testing and should not be a problem, but I am not too sure... (especially the crash caused by double deallocation, which must be avoided at all costs...) |
OK, but considering EnterPlayModeSettings, it is mandatory to dispose or pool with MotionStorage.Reset. |
Yes, I think so. In that case, would it be better to have the Allocator on the MotionStorage side? |
As for naming, I think it is inevitable that NativeAnimationCurve will be UnsafeAnimationCurve if we follow Unity's naming rules. (like UnsafeList and NativeList) |
I consider containers whose safety is checked by AtomicSafetyHandle to be Native-, and containers that are not checked to be Unsafe-. Considering this, wouldn't Native- be more appropriate in this case? |
Sorry, you seem to be right. |
Isn't it safe to release animationcurve in MotionStorage.RemoveAll? |
I considered several implementations and made changes to the implementation.
|
No description provided.