-
-
Notifications
You must be signed in to change notification settings - Fork 580
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
static inline is bad. Generates too much code that the linker can't remove. #1621
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,7 +77,7 @@ class Wrapped { | |
GDExtensionObjectPtr owner; | ||
RecreateInstance *next; | ||
}; | ||
inline static RecreateInstance *recreate_instance = nullptr; | ||
static RecreateInstance *recreate_instance; | ||
#endif | ||
|
||
void _notification(int p_what) {} | ||
|
@@ -408,7 +408,7 @@ protected: | |
// Don't use this for your classes, use GDCLASS() instead. | ||
#define GDEXTENSION_CLASS_ALIAS(m_class, m_alias_for, m_inherits) /******************************************************************************************************************/ \ | ||
private: \ | ||
inline static ::godot::internal::EngineClassRegistration<m_class> _gde_engine_class_registration_helper; \ | ||
static ::godot::internal::EngineClassRegistration<m_class> _gde_engine_class_registration_helper; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is incorrect according to the disassembly and actually running the code... This is the offending line that causes bloat because the linker isn't able to optimize all these templated unused symbols out. The variable is initialized during static initialization when the library is loaded. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This PR is removing the |
||
void operator=(const m_class &p_rval) {} \ | ||
friend class ::godot::ClassDB; \ | ||
friend class ::godot::Wrapped; \ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching this one away from
inline static
is fine, but I have another PR (#1590 - still awaiting review) that removes it as part of fixing a different bug