Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Out-line `Object::_get_property_list_inner` to save on binary space.

Lukas Tenbrink996a495e3dbe
diff --git a/core/object/object.cpp b/core/object/object.cpp
index 98bf0a17f37..6d9315daeb6 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -2066,6 +2066,11 @@ void Object::_bind_methods() {
BIND_BITFIELD_FLAG(CONNECT_APPEND_SOURCE_OBJECT);
}
+void Object::_get_property_list_inner(List<PropertyInfo> *p_list, const StringName &p_class_name) const {
+ p_list->push_back(PropertyInfo(Variant::NIL, p_class_name, PROPERTY_HINT_NONE, p_class_name, PROPERTY_USAGE_CATEGORY));
+ _get_property_list_from_classdb(p_class_name, p_list, true, this);
+}
+
void Object::call_deferredp(const StringName &p_method, const Variant **p_args, int p_argcount, bool p_show_error) {
MessageQueue::get_singleton()->push_callp(this, p_method, p_args, p_argcount);
}
diff --git a/core/object/object.h b/core/object/object.h
index f5452722516..c137b28ab98 100644
--- a/core/object/object.h
+++ b/core/object/object.h
@@ -320,8 +320,7 @@ protected: \
if (!p_reversed) { \
m_inherits::_get_property_listv(p_list, p_reversed); \
} \
- p_list->push_back(PropertyInfo(Variant::NIL, get_class_static(), PROPERTY_HINT_NONE, get_class_static(), PROPERTY_USAGE_CATEGORY)); \
- _get_property_list_from_classdb(#m_class, p_list, true, this); \
+ _get_property_list_inner(p_list, get_class_static()); \
if (m_class::_get_get_property_list() != m_inherits::_get_get_property_list()) { \
_get_property_list(p_list); \
} \
@@ -549,6 +548,9 @@ protected:
bool _property_get_revert(const StringName &p_name, Variant &r_property) const { return false; }
void _notification(int p_notification) {}
+ // Out-lined helper function to save on binary space.
+ _NO_INLINE_ void _get_property_list_inner(List<PropertyInfo> *p_list, const StringName &p_class_name) const;
+
_FORCE_INLINE_ static void (*_get_bind_methods())() {
return &Object::_bind_methods;
}