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

Core: Re-add Variant class initializer, fix comment #91955

Merged

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented May 14, 2024

Fixes two minor issues in variant.h:

@Repiteo Repiteo requested a review from a team as a code owner May 14, 2024 16:37
Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

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

LGTM, but TIWAGOS

core/variant/variant.h Outdated Show resolved Hide resolved
@AThousandShips AThousandShips added this to the 4.3 milestone May 14, 2024
@Repiteo Repiteo force-pushed the core/variant-class-initializer branch from c1c5c88 to 2009c79 Compare May 14, 2024 16:41
@AThousandShips
Copy link
Member

It also technically allocates data for the (packed) arrays and dicts, but for static sized data this is correct

@Repiteo
Copy link
Contributor Author

Repiteo commented May 14, 2024

That should still be fine in this context; allocates extra memory only comments on the times when it will exceed 24/40 bytes in size, not when allocation occurs period.

@AThousandShips
Copy link
Member

AThousandShips commented May 14, 2024

It does exceed that as it allocates a reference to those types, but the size of those depends on pointer sizes and alignment so might be platform dependent, but it does allocate extra data, just not of fixed size, as those data types (including PackedArrayRef<T>, which holds one SafeRefCount and one Vector<T>) do their own allocations

@Repiteo Repiteo force-pushed the core/variant-class-initializer branch from 2009c79 to 7599a7b Compare May 14, 2024 17:20
@Repiteo
Copy link
Contributor Author

Repiteo commented May 14, 2024

Ahhh, now I see what you mean. No harm in making that a footnote as well.

@akien-mga akien-mga merged commit 527bf78 into godotengine:master May 15, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@Repiteo Repiteo deleted the core/variant-class-initializer branch May 15, 2024 11:22
@akien-mga akien-mga changed the title Core: Readd Variant class initializer, fix comment Core: Re-add Variant class initializer, fix comment Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants