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

Use an arena in ContinuousTrajectory #2043

Closed
wants to merge 3 commits into from

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Dec 29, 2018

No description provided.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
};
using InstantPolynomialPairs = std::vector<InstantPolynomialPair>;
using InstantPolynomialPairs =
std::vector<InstantPolynomialPair, ArenaAllocator<InstantPolynomialPair>>;

// May be overridden for testing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment: the result is owned by arena_.

@@ -140,27 +142,26 @@ class ContinuousTrajectory : public Trajectory<Frame> {
// stored in this vector sorted by their |t_max|, as it turns out that we
// never need to extract their |t_min|. Logically, the |t_min| for a
// polynomial is the |t_max| of the previous one. The first polynomial has a
// |t_min| which is |*first_time_|.
// |t_min| which is |*first_time_|. The pointer is owned by |arena_|;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*polynomial is owned by arena_ (so is polynomial in that this struct is allocated there by the vector, but that's not the intent of that comment).

@eggrobin eggrobin added the LGTM label Dec 29, 2018
@eggrobin
Copy link
Member

This means ForgetBefore will not reduce memory usage in-game until the next scene change, which might be a problem.

Sorry, something went wrong.

@eggrobin eggrobin removed the LGTM label Dec 29, 2018
@pleroy
Copy link
Member Author

pleroy commented Jan 4, 2019

Closing this PR. We'll use std::pmr once it's real.

Sorry, something went wrong.

@pleroy pleroy closed this Jan 4, 2019
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.

None yet

2 participants