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

scriptcomp: Avoid needless heap allocs #84

Open
mtijanic opened this issue Jul 17, 2023 · 2 comments
Open

scriptcomp: Avoid needless heap allocs #84

mtijanic opened this issue Jul 17, 2023 · 2 comments

Comments

@mtijanic
Copy link
Collaborator

class CScriptParseTreeNode
{
        ...
	CExoString *m_psStringData;
        ...
	CExoString *m_psTypeName;
        ...

There's really no need for these to be pointers that are then nullchecked and realloced everywhere. Just embed the strings directly into the class. The string data will be heap-allocated anyway.

@fvinke
Copy link

fvinke commented Jul 17, 2023

You can assign me to this if there's no other takers. If there's someone absolutely losing his mind at the opportunity of moving some strings into a class right away it can be reassigned to them instead.

@mtijanic
Copy link
Collaborator Author

I'll leave it up for grabs until the PR for #82 is up. Unless you wanna swap with this one.

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

No branches or pull requests

2 participants