1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Don't inline certain functions for smaller binary size.

Co-authored-by: Thaddeus Crews <repiteo@outlook.com>
This commit is contained in:
Yyf2333
2025-01-25 13:58:50 +08:00
committed by Yufeng Ying
parent fc827bbe25
commit b28d6d1fa3
4 changed files with 20 additions and 6 deletions

View File

@@ -208,7 +208,13 @@ public:
StringName() {}
static void assign_static_unique_class_name(StringName *ptr, const char *p_name);
_FORCE_INLINE_ ~StringName() {
#ifdef SIZE_EXTRA
_NO_INLINE_
#else
_FORCE_INLINE_
#endif
~StringName() {
if (likely(configured) && _data) { //only free if configured
unref();
}

View File

@@ -617,6 +617,9 @@ public:
_FORCE_INLINE_ String(const String &p_str) { _cowdata._ref(p_str._cowdata); }
_FORCE_INLINE_ String(String &&p_str) :
_cowdata(std::move(p_str._cowdata)) {}
#ifdef SIZE_EXTRA
_NO_INLINE_ ~String() {}
#endif
_FORCE_INLINE_ void operator=(const String &p_str) { _cowdata._ref(p_str._cowdata); }
_FORCE_INLINE_ void operator=(String &&p_str) { _cowdata = std::move(p_str._cowdata); }