-
Notifications
You must be signed in to change notification settings - Fork 649
New allocations model #3043
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
New allocations model #3043
Conversation
Profound change to the philosophy of allocations. Stabilizing will take some time.
3e9bc37 to
5911a13
Compare
|
@mafiesto4 Significant improvements! I'm very glad you decided to revise that part. As anyone can follow, I decided to experiment in an isolated environment of my own lib. I'm having successes, but the ideas I tried to introduce in this particular PR give limited advantages. When collections support type-erased allocators, adding new allocators is very simple, but getting to that point takes significant effort. I'm definitely going to make a longer post at some time, as I have a lot of thoughts. For now, I'm giving up on this branch. Too much stuff at once. Maybe I'll give some time to Flax in weeks to come. I have a game to finish xD |
Issues
This PR features experimental changes to Flax allocation policy model. Unfortunately, previous one suffered issues:
CalculateCapacityGrowthis pure, but this means it could be moved completely outside of the Data class.Decisions
MinCapacityandMaxCapacity. This will help the collection automatically select the capacity of the collection.ClearToFreeandShrinkToFit(with oldEnsureCapacity). So collections themselves are given more control over the capacity of the collections.Platform::Copyfor trivially/bitwise copyable types. This method also allows to automatically select the method of transferring allocations data (e.g. pointer swap).Tasks
CalculateCapacityGrow,Relocate.Final Note
Stabilizing this branch will take me weeks, I would be super glad if I was given feedback frequently.