You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Optimize Object::get_class_name
* Run the static function once per class instead of one per instance. * Saves some memory in Object derived classes.
This commit is contained in:
@@ -201,6 +201,14 @@ StringName::StringName(const StringName &p_name) {
|
||||
}
|
||||
}
|
||||
|
||||
void StringName::assign_static_unique_class_name(StringName *ptr, const char *p_name) {
|
||||
mutex.lock();
|
||||
if (*ptr == StringName()) {
|
||||
*ptr = StringName(p_name, true);
|
||||
}
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
StringName::StringName(const char *p_name, bool p_static) {
|
||||
_data = nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user